@svadmin/graphql 0.3.0 → 0.5.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/graphql",
3
- "version": "0.3.0",
3
+ "version": "0.5.12",
4
4
  "description": "GraphQL DataProvider for svadmin",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -16,10 +16,15 @@
16
16
  }
17
17
  },
18
18
  "peerDependencies": {
19
- "@svadmin/core": "^0.3.0"
19
+ "@svadmin/core": "^0.5.0"
20
20
  },
21
21
  "dependencies": {
22
22
  "graphql-request": "^7.1.0"
23
23
  },
24
- "license": "MIT"
24
+ "license": "MIT",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/zuohuadong/svadmin.git",
28
+ "directory": "packages/graphql"
29
+ }
25
30
  }
@@ -56,14 +56,14 @@ export function createGraphQLDataProvider(options: GraphQLDataProviderOptions):
56
56
 
57
57
  async create<T>({ resource, variables, meta }: CreateParams): Promise<CreateResult<T>> {
58
58
  const query = getQuery(meta, 'create', resource);
59
- const allVars: Variables = { ...variables, ...getMetaVars(meta) };
59
+ const allVars: Variables = { ...(variables as Record<string, unknown>), ...getMetaVars(meta) };
60
60
  const response = await client.request<{ data: T }>(query, allVars);
61
61
  return { data: response.data };
62
62
  },
63
63
 
64
64
  async update<T>({ resource, id, variables, meta }: UpdateParams): Promise<UpdateResult<T>> {
65
65
  const query = getQuery(meta, 'update', resource);
66
- const allVars: Variables = { id, ...variables, ...getMetaVars(meta) };
66
+ const allVars: Variables = { id, ...(variables as Record<string, unknown>), ...getMetaVars(meta) };
67
67
  const response = await client.request<{ data: T }>(query, allVars);
68
68
  return { data: response.data };
69
69
  },