prisma / prisma-content-feedback

Feedback for documentation, articles, tutorials, examples, ...
https://www.prisma.io/docs/
6 stars 2 forks source link

Blog: objectType or query/mutationType? #107

Closed heymartinadams closed 5 years ago

heymartinadams commented 5 years ago

Blog Post Introducing GraphQL Nexus: Code-First GraphQL Server Development

Describe the content issue In the blog post linked above (a follow-up blog post to #105) it says:

const Query = queryType({
const Mutation = mutationType({

Yet the official Nexus repo defines a query and mutation like this:

const Query = objectType({
const Mutation = objectType({

So confused: which is which?

nikolasburk commented 5 years ago

Hey Martin, sorry if the docs don't make this clear. queryType and mutationType are shortcuts for:

const Query = objectType({
  name: 'Query',
  // ...
})

and

const Mutation = objectType({
  name: 'Mutation',
  // ...
})