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

fix(gatsby): pass custom graphql context provided by createResolverContext to materialization executor #36552

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Sep 6, 2022

Description

Resolver / graphql context that plugins can inject was not available during materialization. This will happen only if the query would sort or filter on fields with custom resolvers that rely on that custom context, so it wasn't failing all the time (just depending on query).

Related Issues

datocms/gatsby-source-datocms#196

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Sep 6, 2022
@pieh pieh added topic: GraphQL Related to Gatsby's GraphQL layer topic: data Relates to source-nodes, internal-data-bridge, and node creation and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Sep 6, 2022
@pieh pieh force-pushed the fix/resolver-context-materialization branch from 22caa9b to 0fabe76 Compare September 6, 2022 16:55
@@ -875,6 +885,7 @@ function resolveField(
schema,
schemaComposer,
nodeModel,
customContext,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is main fix - rest is just "prop drilling" to get it here

Copy link
Contributor

@imjoshin imjoshin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@LekoArts LekoArts merged commit 8aeae21 into master Sep 7, 2022
@LekoArts LekoArts deleted the fix/resolver-context-materialization branch September 7, 2022 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: data Relates to source-nodes, internal-data-bridge, and node creation topic: GraphQL Related to Gatsby's GraphQL layer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants