Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Allow ASTs in extractTypeMapFromTypeDefs #197

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stith
Copy link

@stith stith commented Feb 15, 2019

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

@johnymontana
Copy link
Contributor

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?)

@michaeldgraham
Copy link
Collaborator

#608

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.

3 participants