You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using graphqlSync to execute code against a schema on app startup. Upgrading from graphql@15 to graphql@16 (and no other changes) breaks my code.
import{makeExecutableSchema}from'@graphql-tools/schema'import{graphqlSync,print}from'graphql'import{gql}from'apollo-server-koa'constschema=makeExecutableSchema({typeDefs: '...',resolvers: {...},})constquery=print(gql` query { p: __type(name: "InputOne") { inputFields { name type { kind } } } m: __type(name: "InputTwo") { inputFields { name type { kind } } } a: __type(name: "InputThree") { inputFields { name type { kind } } } } `)console.log(schema)// Prints out a schemaconsole.log(query)// Prints out a queryconsttypeFields=graphqlSync(schema,query).data
The above fails using graphql@16 with the following error:
/home/.../src/api/node_modules/graphql/type/schema.js:35
throw new Error(
^
Error: Expected undefined to be a GraphQL schema.
at assertSchema (/home/.../src/api/node_modules/graphql/type/schema.js:35:11)
at validateSchema (/home/.../src/api/node_modules/graphql/type/validate.js:34:28)
at graphqlImpl (/home/.../src/api/node_modules/graphql/graphql.js:52:64)
at graphqlSync (/home/.../src/api/node_modules/graphql/graphql.js:31:18)
at file:///home/.../src/graphql/schema/index.js:30:20
at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
at async Promise.all (index 0)
The text was updated successfully, but these errors were encountered:
I am using
graphqlSync
to execute code against a schema on app startup. Upgrading fromgraphql@15
tographql@16
(and no other changes) breaks my code.The above fails using graphql@16 with the following error:
/home/.../src/api/node_modules/graphql/type/schema.js:35 throw new Error( ^ Error: Expected undefined to be a GraphQL schema. at assertSchema (/home/.../src/api/node_modules/graphql/type/schema.js:35:11) at validateSchema (/home/.../src/api/node_modules/graphql/type/validate.js:34:28) at graphqlImpl (/home/.../src/api/node_modules/graphql/graphql.js:52:64) at graphqlSync (/home/.../src/api/node_modules/graphql/graphql.js:31:18) at file:///home/.../src/graphql/schema/index.js:30:20 at ModuleJob.run (node:internal/modules/esm/module_job:185:25) at async Promise.all (index 0)
The text was updated successfully, but these errors were encountered: