Skip to content

TheMindset/graphql_DD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graphql Deep Dive

Resolver arguments

La fonction resolver accepte 4 arguments

app.use(mount('/graphql', graphqlHTTP({
  schema: schema,
  graphiql: true,
  context: {
    user: "1"
  }
})))


const resolvers = {
  Query: {
    hello(parent, args, context, info) {
      return 'Hello from GraphQL'
    }
  }
}
  • parent: The object that contains the result returned from the resolver on the parent field.

  • args: An object with the arguments passed into the field in the query.

  • context: This is an object shared by all resolvers in a particular query. Exemple the current user.

  • info: It contains information about the execution state of the query, including the field name, path to the field from the root.

Releases

No releases published

Packages

No packages published