question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Context argument to GraphQL#execute() should be explicit in next breaking version

See original GitHub issue

The reference implementation now has an explicit context value that is separate from the root value. So in that implementation, GraphQL#execute() now looks like:

export function execute(
  schema: GraphQLSchema,
  documentAST: Document,
  rootValue?: mixed,
  contextValue?: mixed,
  variableValues?: ?{[key: string]: mixed},
  operationName?: ?string
): Promise<ExecutionResult> {

We should probably follow in our next breaking version.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
andimarekcommented, May 23, 2017

This is the proposal:

  • We will add a root object: This will be presented as root to DataFetchers
  • root will be the source object for the first query

This is a breaking change.

0reactions
andimarekcommented, Jul 1, 2017

the PR is merged and will be in the next release

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolvers - Apollo GraphQL Docs
A resolver is a function that's responsible for populating the data for a single field in your schema. It can populate that data...
Read more >
Versioning fields in GraphQL - LogRocket Blog
Through versioning, breaking changes are added to a new version of the API, and since clients need to explicitly point to the new...
Read more >
Execution - GraphQL
After being validated, a GraphQL query is executed by a GraphQL server which returns a result that mirrors the shape of the requested...
Read more >
Resolver mapping template context reference - AWS AppSync
The $context variable is a map that holds all of the contextual information for your resolver invocation. It has the following structure: {...
Read more >
DataFetchingEnvironment (graphql-java 15.0 API) - Javadoc.io
getLocalContext() which can be used to pass down extra information to fields ... Returns a context argument that is set up when the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found