Skip to content

Commit

Permalink
Convert GraphQL SDL to AST before passing to Apollo
Browse files Browse the repository at this point in the history
Apollo released a breaking change in a semver-minor which causes it to
stop understanding the SDL (string) GraphQL typeDefs we were passing it.
This fix ensures we're converting to an AST to avoid the error being
thrown.

See apollographql/apollo-server#2921

Fixes #1340
  • Loading branch information
jesstelford committed Jun 26, 2019
1 parent c2dc6eb commit f50385e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/keystone/lib/Keystone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,10 @@ module.exports = class Keystone {
console.log(resolvers);
}

return { typeDefs, resolvers };
return {
typeDefs: typeDefs.map(typeDef => gql`${typeDef}`),
resolvers,
};
}

dumpSchema(file) {
Expand Down

0 comments on commit f50385e

Please sign in to comment.