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

Removes graphQLSchemaExtension export in favour of using either graphql.extend or @graphql-tool/schema #7943

Merged
merged 27 commits into from
Sep 29, 2022

Conversation

borisno2
Copy link
Member

Removes the graphQLSchemaExtension export from @keystone-6/core in favour of using either graphql.extend or @graphql-tool/schema directly.

This API used @graphql-tools/schema to merge custom typeDefs and resolvers into the keystone-generated GraphQL schema. Removing this API still allows a developer to use @graphql-tools/schema for the same outcome, just more explicitly.

So instead of:

export const extendGraphqlSchema = graphQLSchemaExtension<Context>({
  typeDefs:`
        type Mutation {
           // Custom Mutation Types
        }
    `,
  resolvers: {
      // Custom Resolvers
   }

Now it would look like this:

import { mergeSchemas } from '@graphql-tools/schema';

export const extendGraphqlSchema = (schema: GraphQLSchema) =>
  mergeSchemas({
    schemas: [schema],
    typeDefs: `
        type Mutation {
           // Custom Mutation Types
        }
    `,
  resolvers: {
      // Custom Resolvers
   }
});

Also updated docs and added a guide for using extendGraphqlSchema

@vercel
Copy link

vercel bot commented Sep 21, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
keystone-next-docs ✅ Ready (Inspect) Visit Preview Sep 29, 2022 at 4:21AM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Sep 21, 2022

🦋 Changeset detected

Latest commit: 44bdee8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 44 packages
Name Type
@keystone-6/core Major
@keystone-6/example-assets-local Patch
@keystone-6/example-assets-s3 Patch
@keystone-6/example-auth Patch
@keystone-6/example-app-basic Patch
@keystone-6/example-blog Patch
@keystone-6/example-custom-admin-ui-logo Patch
@keystone-6/example-custom-admin-ui-navigation Patch
@keystone-6/example-custom-admin-ui-pages Patch
@keystone-6/example-custom-field-view Patch
@keystone-6/example-custom-field Patch
@keystone-6/example-with-custom-session-validation Patch
@keystone-6/example-default-values Patch
@keystone-6/example-document-field Patch
@keystone-6/example-ecommerce Patch
@keystone-6/example-embedded-nextjs Patch
@keystone-6/example-extend-graphql-schema-graphql-tools Patch
@keystone-6/example-extend-graphql-schema-graphql-ts Patch
@keystone-6/example-extend-graphql-schema-nexus Patch
@keystone-6/example-extend-graphql-subscriptions Patch
@keystone-6/example-feature-boilerplate Patch
@keystone-6/example-graphql-ts-gql Patch
@keystone-6/example-json-field Patch
@keystone-6/example-rest-api Patch
@keystone-6/example-roles Patch
@keystone-6/example-script Patch
@keystone-6/singleton Patch
@keystone-6/example-task-manager Patch
@keystone-6/example-testing Patch
@keystone-6/example-virtual-field Patch
@keystone-6/example-with-auth Patch
@keystone-6/example-document-field-customisation-keystone-server Patch
@keystone-6/example-e2e-boilerplate-keystone-server Patch
@keystone-6/auth Major
@keystone-6/cloudinary Major
@keystone-6/fields-document Major
@keystone-6/session-store-redis Major
@keystone-6/benchmarks-legacy Patch
@keystone-6/test-projects-basic Patch
@keystone-6/test-projects-crud-notifications Patch
@keystone-6/test-projects-live-reloading Patch
@keystone-6/sandbox Patch
@keystone-6/generate-artifacts-for-projects Patch
@keystone-6/website Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel vercel bot temporarily deployed to Preview September 21, 2022 05:04 Inactive
@borisno2 borisno2 self-assigned this Sep 21, 2022
@vercel vercel bot temporarily deployed to Preview September 23, 2022 03:26 Inactive
@borisno2 borisno2 force-pushed the extendGraphQLSchema-docs-updates branch from b7d50ee to 681ac15 Compare September 26, 2022 01:06
@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 26, 2022

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 44bdee8:

Sandbox Source
@keystone-6/sandbox Configuration

@vercel vercel bot temporarily deployed to Preview September 26, 2022 01:09 Inactive
@vercel vercel bot temporarily deployed to Preview September 26, 2022 01:26 Inactive
@vercel vercel bot temporarily deployed to Preview September 26, 2022 01:49 Inactive
@borisno2 borisno2 force-pushed the extendGraphQLSchema-docs-updates branch from 6350eb1 to 6d09d10 Compare September 26, 2022 02:40
@vercel vercel bot temporarily deployed to Preview September 26, 2022 02:43 Inactive
@vercel vercel bot temporarily deployed to Preview September 26, 2022 05:43 Inactive
@vercel vercel bot temporarily deployed to Preview September 26, 2022 05:53 Inactive
Copy link
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove @graphql-tools/schema as a dep of @keystone-6/core?

@vercel vercel bot temporarily deployed to Preview September 26, 2022 06:29 Inactive
@vercel vercel bot temporarily deployed to Preview September 26, 2022 06:37 Inactive
Co-authored-by: Mitchell Hamilton <mitchell@hamil.town>
@vercel vercel bot temporarily deployed to Preview September 26, 2022 07:02 Inactive
@vercel vercel bot temporarily deployed to Preview September 26, 2022 07:07 Inactive
@borisno2 borisno2 force-pushed the extendGraphQLSchema-docs-updates branch from 0ca35bf to 0fff08a Compare September 26, 2022 07:08
@borisno2 borisno2 force-pushed the extendGraphQLSchema-docs-updates branch from 0fff08a to 5acac12 Compare September 26, 2022 07:09
@vercel vercel bot temporarily deployed to Preview September 26, 2022 07:12 Inactive
@borisno2 borisno2 enabled auto-merge (squash) September 27, 2022 03:37
@vercel vercel bot temporarily deployed to Preview September 27, 2022 03:37 Inactive
@vercel vercel bot temporarily deployed to Preview September 29, 2022 04:10 Inactive
@vercel vercel bot temporarily deployed to Preview September 29, 2022 04:21 Inactive
@borisno2 borisno2 merged commit 494cdef into main Sep 29, 2022
@borisno2 borisno2 deleted the extendGraphQLSchema-docs-updates branch September 29, 2022 04:46
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.

3 participants