neo4j-graphql-js icon indicating copy to clipboard operation
neo4j-graphql-js copied to clipboard

Allow ASTs in extractTypeMapFromTypeDefs

Open stith opened this issue 6 years ago • 2 comments

This lets you use preprocessed ASTs from stuff like apollographql/graphql-tag with this library. Eg:

import schemaGql from './schema.gql';
// or...
const schemaGql = gql` ... `;

const schema = makeExecutableSchema({
  typeDefs: augmentTypeDefs(schemaGql),
  resolvers,
});

const neoAugmentedSchema = augmentSchema(schema);

const apolloServer = new ApolloServer({
  schema: neoAugmentedSchema
  // ...

This required moving graphql to peerDependencies so that this package can use the graphql version provided by consumers of this package. Otherwise, this line in graphql-js causes problems due to Source technically being a different type.

Also:

  • Bump version to 2.4.0
  • Update nyc to address vuln identified by npm audit

stith avatar Feb 15 '19 07:02 stith

Thanks @stith for the PR!

Moving graphql.js to a peer dependency would be a breaking change for this library so we'd need to save this for the 3.x release cycle (which will probably be March timeframe). Is there a way to implement this that wouldn't require moving graphql.js to a peer dependency? (For example, does upgrading to graphql.js. v14.1.1 fix the error you mentioned?)

johnymontana avatar Feb 19 '19 18:02 johnymontana

https://github.com/neo4j-graphql/neo4j-graphql-js/issues/608

michaeldgraham avatar May 02 '21 04:05 michaeldgraham