@jsb188/graphql 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cache/config.ts CHANGED
@@ -45,7 +45,7 @@ export const PARTIALS_MAP = {
45
45
  chatPartial: 'chatFragment',
46
46
  chatStatusPartial: 'chatFragment',
47
47
  userPartial: 'userFragment',
48
- };
48
+ } as Record<string, string>;
49
49
 
50
50
  /**
51
51
  * Set up config, so the package can use app's variables
@@ -188,10 +188,38 @@ mutation changePassword (
188
188
  $currentPassword: String!
189
189
  $password: String!
190
190
  $passwordRepeat: String!
191
+ $token: Token
191
192
  ) {
192
193
  changePassword (
193
194
  currentPassword: $currentPassword
194
195
  password: $password
195
196
  passwordRepeat: $passwordRepeat
197
+ token: $token
198
+ )
199
+ }`;
200
+
201
+ export const requestTokenizedEmailMtn = gql`
202
+ mutation requestTokenizedEmail (
203
+ $email: String!
204
+ $requestType: TokenType!
205
+ ) {
206
+ requestTokenizedEmail (
207
+ email: $email
208
+ requestType: $requestType
196
209
  )
197
210
  }`;
211
+
212
+ export const consumeTokenMtn = gql`
213
+ mutation consumeToken (
214
+ $token: Token!
215
+ $expected: TokenType
216
+ ) {
217
+ consumeToken (
218
+ token: $token
219
+ expected: $expected
220
+ ) {
221
+ id
222
+ success
223
+ value
224
+ }
225
+ }`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsb188/graphql",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "GraphQL client for react, using recoil",
5
5
  "license": "ISC",
6
6
  "author": "jsb188",
package/types.d.ts CHANGED
@@ -29,3 +29,16 @@ export interface GraphQLHandlers {
29
29
  export type UpdateObserversFn = (args: UpdateDataObserverArgs) => void;
30
30
  export type OnCompletedGQLFn = (data: any, error: ServerErrorObj | null, variables: any) => void;
31
31
  export type OnErrorGQLFn = (error: ServerErrorObj | null, variables: any) => void;
32
+
33
+ // Params for most GraphQL hooks
34
+
35
+ export type UseGraphQLParams = Partial<{
36
+ onCompleted: OnCompletedGQLFn;
37
+ onError: OnErrorGQLFn;
38
+ }>;
39
+
40
+ // Params for most GraphQL hooks with these options
41
+
42
+ export type UseGraphQLParamsExtra = Partial<{
43
+ checkMountedBeforeCallback?: boolean;
44
+ }> & UseGraphQLParams;