-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce Nexus example to define extension inline #8375
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit a211c87:
|
45c05c5
to
dd9c0f2
Compare
t.string('status'); | ||
t.string('content'); | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't actually required, we needed to use graphql-nexus/nexus#983
NexusThingQuery, | ||
}, | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this updated example is equivalent in fidelity to our extend-graphql-schema-graphql-ts
example?
@@ -40,18 +40,20 @@ export function extendGraphqlSchema(baseSchema: GraphQLSchema) { | |||
t.field('nexusPosts', { | |||
type: nexus.nonNull(nexus.list('Post')), | |||
args: { | |||
authorId: nexus.stringArg(), | |||
id: nexus.nonNull(nexus.stringArg()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is inline with our other examples
}, | ||
contextType: { | ||
module: path.join(process.cwd(), 'node_modules', '.keystone', 'types.d.ts'), | ||
export: 'Context', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if I prefer this to context: Context
, but, it's how nexus works
This pull request reduces the complexity of the Nexus example to something that would be more canonically written as an
extendGraphqlSchema
function.This format is inline with how we are using
extendGraphqlSchema
in extend-graphql-schema-graphql-ts and extend-graphql-schema-graphql-tools.This is a followup to #6792