-
Notifications
You must be signed in to change notification settings - Fork 1.1k
RFC Allow recursion within ResolveAbstractType #960
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
Conversation
This formalizes the proprosed feature within `graphql-js` whereby the internal method provided by JavaScript for runtime type resolution is allowed to return an intermediate interface. See: Issue: graphql/graphql-js#3253 PR: graphql/graphql-js#3599 @IvanGoncharov [suggested](graphql/graphql-js#3599 (review)) that this would require a spec change. Alternatively, perhaps the recursion [should be considered to be a feature of the internal system](graphql/graphql-js#3599 (comment)) itself, possibly limited to JavaScript-like implementations. This PR provides some potential spec text, were a spec change to be considered necessary.
✅ Deploy Preview for graphql-spec-draft ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Co-authored-by: Benjie Gillam <[email protected]>
{objectValue}. | ||
- If {possibleRuntimeType} is an Interface type: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following up on discussion - this probably needs an assertion that {possibleRuntimeType}
(maybe {resolvedType}
?) implements {abstractType}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm. This PR allows the internal type system method to resolve to either an object or to a transitive interface. Everything should be fine as long as the internal type system method returns a type that implements the original abstract type, so an assertion is required.
However, the existing behavior also requires a similar assertion, as well as requiring an assertion that the internal method returned an object type. Perhaps to better clarify the proposed change, we should have a separate PR that adds the current assertions/behavior to the spec, and this PR can then modify/loosen those assertions/behavior as desired.
See: #973
This proposal is currently in need of a new champion. I am no longer convinced that we need to provide it within the specification, as it is implementable in user land. |
This formalizes the proprosed feature within
graphql-js
whereby the internal method provided by JavaScript for runtime type resolution is allowed to return an intermediate interface.See:
Issue: graphql/graphql-js#3253
PR: graphql/graphql-js#3599
@IvanGoncharov suggested that this would require a spec change. Alternatively, perhaps the recursion should be considered to be a feature of the internal system itself, possibly limited to JavaScript-like implementations.
This PR provides some potential spec text, were a spec change to be considered necessary.