Skip to content

Commit 7bebc2c

Browse files
authored
Merge pull request #289 from maxschmeling/285-fix-graphql-updates
Fixed GraphQL hard-coded resource name on updates
2 parents 756d55c + e9c30ac commit 7bebc2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/graphQl/resolvers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ resolvers.create = (resourceConfig, parent, args, req, ast) => {
3030
}
3131

3232
resolvers.update = (resourceConfig, parent, args, req, ast) => {
33-
const path = `${jsonApi._apiConfig.pathPrefix + resourceConfig.resource}/${args.tags.id}`
33+
const path = `${jsonApi._apiConfig.pathPrefix + resourceConfig.resource}/${args[resourceConfig.resource].id}`
3434
const data = resolvers.generateResourceFromArgs(args, resourceConfig)
3535
return resolvers.rerouteTo('PATCH', path, { data }, req, ast)
3636
}

0 commit comments

Comments
 (0)