Skip to content

buildSchema/extendSchema: add support for extensions#2248

Merged
IvanGoncharov merged 1 commit intographql:masterfrom
IvanGoncharov:buildSchema-support-extensions
Dec 27, 2019
Merged

buildSchema/extendSchema: add support for extensions#2248
IvanGoncharov merged 1 commit intographql:masterfrom
IvanGoncharov:buildSchema-support-extensions

Conversation

@IvanGoncharov
Copy link
Copy Markdown
Member

Fixes #922

@IvanGoncharov IvanGoncharov added the PR: feature 🚀 requires increase of "minor" version number label Nov 6, 2019
@IvanGoncharov
Copy link
Copy Markdown
Member Author

Current state:

  • Missing support for schema extensions
  • Missing tests for Enums, Input Object, and Unions
  • Missing tests for extendSchema

@IvanGoncharov IvanGoncharov mentioned this pull request Dec 23, 2019
@IvanGoncharov IvanGoncharov force-pushed the buildSchema-support-extensions branch from cae9794 to 2616417 Compare December 27, 2019 05:36
@IvanGoncharov IvanGoncharov marked this pull request as ready for review December 27, 2019 05:36
@IvanGoncharov IvanGoncharov merged commit 1283c84 into graphql:master Dec 27, 2019
@IvanGoncharov IvanGoncharov deleted the buildSchema-support-extensions branch December 27, 2019 06:17
@IvanGoncharov IvanGoncharov added PR: breaking change 💥 implementation requires increase of "major" version number and removed PR: feature 🚀 requires increase of "minor" version number labels Jan 7, 2020
@sonamp
Copy link
Copy Markdown

sonamp commented May 24, 2022

Looks like it is not supported anymore. @IvanGoncharov could you please confirm if the extend type support is still there?

@yaacovCR
Copy link
Copy Markdown
Contributor

What version are you using? Can you post a link to a reproduction?

@sonamp
Copy link
Copy Markdown

sonamp commented May 26, 2022

@yaacovCR Seems the issue is with graphql-tools/load, it doesn't recognize extend in schema

schema.graphql--
extend type Post {
    createdAt: String
}

Running code

const load = require('@graphql-tools/load')
const { GraphQLFileLoader } = require('@graphql-tools/graphql-file-loader')

async function main() {
const c = await load.loadSchema('/code/graphqlPoc/graphql-server/src/schema.graphql', {
    loaders: [new GraphQLFileLoader()]
})
console.log(c)
}
main()

return errors --

Error: Cannot extend type "Post" because it is not defined.
    at assertValidSDL (/code/graphqlPoc/node_modules/graphql/validation/validate.js:135:11)
    at Object.buildASTSchema (/code/graphqlPoc/node_modules/graphql/utilities/buildASTSchema.js:44:34)
    at makeExecutableSchema (/code/graphqlPoc/node_modules/@graphql-tools/schema/index.js:495:26)
    at Object.mergeSchemas (/code/graphqlPoc/node_modules/@graphql-tools/schema/index.js:532:12)
    at Object.loadSchema (/code/graphqlPoc/node_modules/@graphql-tools/load/index.js:622:29)
    at async main (/code/graphqlPoc/graphql-server/src/graph.js:5:11)

@graphql-tools/load - v7.5.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: breaking change 💥 implementation requires increase of "major" version number

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buildASTSchema() should throw on encountering extend definition

3 participants