Skip to content
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

Merged
merged 5 commits into from
Mar 7, 2023
Merged

Reduce Nexus example to define extension inline #8375

merged 5 commits into from
Mar 7, 2023

Conversation

dcousens
Copy link
Member

@dcousens dcousens commented Mar 6, 2023

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

@changeset-bot

This comment was marked as resolved.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 6, 2023

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:

Sandbox Source
@keystone-6/sandbox Configuration

@dcousens dcousens force-pushed the nexus-less branch 2 times, most recently from 45c05c5 to dd9c0f2 Compare March 6, 2023 08:18
t.string('status');
t.string('content');
},
});
Copy link
Member Author

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

@dcousens dcousens self-assigned this Mar 6, 2023
NexusThingQuery,
},
});
}
Copy link
Member Author

@dcousens dcousens Mar 6, 2023

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()),
Copy link
Member Author

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',
Copy link
Member Author

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

@dcousens dcousens requested review from borisno2 and removed request for JedWatson and emmatown March 7, 2023 04:41
@dcousens dcousens enabled auto-merge (squash) March 7, 2023 04:41
@dcousens dcousens merged commit b91c11e into main Mar 7, 2023
@dcousens dcousens deleted the nexus-less branch March 7, 2023 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants