Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap mergeSchemas with makeExecutableSchema #347

Merged
merged 1 commit into from
Mar 30, 2020

Conversation

RobertBroersma
Copy link
Contributor

Basically the title says it all!

Motivation in #333

Unfortunately what @peterp mentioned in #333 (comment) didn't fly; just swapping out apollo-server-lambda for graphql-tools-fork didn't work. It seems like graph-tools-fork is improving on the seemingly abandoned graphql-tools, but not (yet) on custom directive support for mergeSchemas.

What does however support custom directives is makeExecutableSchema. In order to use this I needed to merge the typeDefs, and the only/quickest/cleanest way I could find to do this is using merge-graphql-schemas, the second package mentioned by @peterp.

Using this PR you can pass schemaDirectives in makeMergedSchemas like so:

schema: makeMergedSchema({
  schemas,
  services: makeServices({ services }),
  schemaDirectives: {
    auth: AuthDirective,
  },
}),

@peterp
Copy link
Contributor

peterp commented Mar 27, 2020

This is awesome, thank you!

@peterp peterp merged commit f6d3c21 into redwoodjs:master Mar 30, 2020
@RobertBroersma RobertBroersma deleted the schema-directives branch March 30, 2020 14:32
mohsen1 pushed a commit to mohsen1/redwood that referenced this pull request Apr 12, 2020
Swap mergeSchemas with makeExecutableSchema
@thedavidprice thedavidprice added this to the unassigned-version milestone May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants