Skip to content

fix: change the execute call signature which is removed in GraphQL.js 16#5662

Closed
n1ru4l wants to merge 1 commit intoapollographql:mainfrom
n1ru4l:fix-execute-call-signature
Closed

fix: change the execute call signature which is removed in GraphQL.js 16#5662
n1ru4l wants to merge 1 commit intoapollographql:mainfrom
n1ru4l:fix-execute-call-signature

Conversation

@n1ru4l
Copy link
Contributor

@n1ru4l n1ru4l commented Aug 27, 2021

I am currently testing the GraphQL.js 16 RC and this is causing issues. https://github.com/n1ru4l/graphql-js/blob/0fef3c49907b63b1ea5a4ff1da7011775f465fc2/src/execution/execute.ts

Using the single object argument signature is fine with older GraphQL.js versions. This is a non-breaking change.

FAIL packages/plugins/apollo-server-errors/test/apollo-server-errors.spec.ts (545 MB heap size)
  ● useApolloServerErrors › should return the same output when Error is thrown from a resolver (debug=false)

    Must provide document.

       8 | describe('useApolloServerErrors', () => {
       9 |   const executeBoth = async (schema: GraphQLSchema, query: string, debug: boolean) => {
    > 10 |     const apolloServer = new ApolloServerBase({ schema, debug });
         |                          ^
      11 |     const envelopRuntime = envelop({ plugins: [useSchema(schema), useApolloServerErrors({ debug })] })({});
      12 |
      13 |     return {

      at devAssert (node_modules/graphql/jsutils/devAssert.js:12:11)
      at assertValidExecutionArguments (node_modules/graphql/execution/execute.js:145:40)
      at Object.execute (node_modules/graphql/execution/execute.js:74:3)
      at Object.generateSchemaHash (node_modules/apollo-server-core/src/utils/schemaHash.ts:12:18)
      at ApolloServerBase.generateSchemaDerivedData (node_modules/apollo-server-core/src/ApolloServer.ts:671:24)
      at Object.schemaDerivedDataProvider (node_modules/apollo-server-core/src/ApolloServer.ts:288:18)
      at new SchemaManager (node_modules/apollo-server-core/src/utils/schemaManager.ts:75:15)
      at new ApolloServerBase (node_modules/apollo-server-core/src/ApolloServer.ts:283:24)
      at executeBoth (packages/plugins/apollo-server-errors/test/apollo-server-errors.spec.ts:10:26)
      at Object.<anonymous> (packages/plugins/apollo-server-errors/test/apollo-server-errors.spec.ts:35:27)

@IvanGoncharov
Copy link
Contributor

@n1ru4l Thanks for PR 👍
Was working on this in parallel #5605
Just published a more complete fix as #5664

@n1ru4l n1ru4l deleted the fix-execute-call-signature branch August 27, 2021 14:50
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants