mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-01-19 03:11:24 +00:00
Rename variable, mutation
- result is not a good name in this case because we know what is coming back, the result is a socialMedia node - update the mutation name in the front end
This commit is contained in:
parent
832afee51d
commit
4de8407620
@ -3,19 +3,19 @@ import { neo4jgraphql } from 'neo4j-graphql-js'
|
||||
export default {
|
||||
Mutation: {
|
||||
CreateSocialMedia: async (object, params, context, resolveInfo) => {
|
||||
const result = await neo4jgraphql(object, params, context, resolveInfo, true)
|
||||
const socialMedia = await neo4jgraphql(object, params, context, resolveInfo, true)
|
||||
const session = context.driver.session()
|
||||
await session.run(
|
||||
`MATCH (owner:User {id: $userId}), (socialMedia:SocialMedia {id: $socialMediaId})
|
||||
MERGE (socialMedia)<-[:OWNED]-(owner)
|
||||
RETURN owner`, {
|
||||
userId: context.user.id,
|
||||
socialMediaId: result.id
|
||||
socialMediaId: socialMedia.id
|
||||
}
|
||||
)
|
||||
session.close()
|
||||
|
||||
return result
|
||||
return socialMedia
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ export default {
|
||||
.mutate({
|
||||
mutation: gql`
|
||||
mutation($url: String!) {
|
||||
addSocialMedia(url: $url)
|
||||
CreateSocialMedia(url: $url)
|
||||
}
|
||||
`,
|
||||
variables: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user