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 incorrect context hierarchy when using extensions #476

Closed
wants to merge 1 commit into from

Conversation

sfriedel
Copy link
Contributor

When using an extension that creates new child contexts in ResolveFieldDidStart the resulting context hierarchy is wrong.

Given the query

query {
  a {
    foo
    bar
    baz
  }
}

the following context hierarchy would be created

a
|
+-> foo
    |
    +-> bar
        |
        +-> baz

So each context has the context of the previously executed field as a parent context.

This PR changes this so that the context in each field has the parent context of the parent field:

a
|
+-> foo
|    
+-> bar
|
+-> baz

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 92.37% when pulling 19e9704 on civist:fix-context-hierarchy into 199d20b on graphql-go:master.

@sfriedel
Copy link
Contributor Author

closing this PR for the now because we noticed that it breaks error propagation in some cases

@sfriedel sfriedel closed this Apr 15, 2019
@Fontinalis
Copy link
Collaborator

Fontinalis commented Apr 15, 2019 via email

@sfriedel sfriedel mentioned this pull request Apr 23, 2019
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.

3 participants