RFC Allow recursion within ResolveAbstractType#960
RFC Allow recursion within ResolveAbstractType#960yaacovCR wants to merge 2 commits intographql:mainfrom
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 <benjie@jemjie.com>
| - Let {possibleRuntimeType} be the result of calling the internal method | ||
| provided by the type system, given Abstract type {abstractType} and value | ||
| {objectValue}. | ||
| - If {possibleRuntimeType} is an Interface type: |
There was a problem hiding this comment.
Following up on discussion - this probably needs an assertion that {possibleRuntimeType} (maybe {resolvedType}?) implements {abstractType}?
There was a problem hiding this comment.
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-jswhereby 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.