You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using interface hierarchies extensively in our GraphQL schema and encountered an issue with GraphQXL when attempting to override a field's return type in a type implementation. According to the GraphQL specification, it is valid for a field in an implementing type to override the return type of the interface field with a more specific type, provided the new type implements the original return type. However, GraphQXL fails to compile when the spread syntax (...) is used, even though this is spec-compliant.
Example Schema:
# Definition of an interfaceInterfaceI1 {
}
# Definition of a type that implements the interfaceTypeT1implementsI1 {
}
# Interface with multiple fields, including a field of type I1InterfaceBase {
field: I1 # many more fields
}
# Implementation without spread syntax - This worksTypeBaseTypeimplementsBase {
field: T1 # Valid as T1 implements I1 # all other fields of interface Base are manually copied
}
# Implementation with spread syntax - This fails to compileTypeBaseTypeimplementsBase {
...Basefield: T1 # Valid as T1 implements I1 but fails compilation
}
Expected Behavior:
The schema should compile successfully, as overriding field with T1 is valid per the GraphQL spec, and the spread syntax should allow inclusion of all other fields from the Base interface without redundancy.
Observed Behavior:
GraphQXL fails to compile when the spread syntax is used, forcing us to manually copy all other fields from the Base interface to ensure compatibility.
Request you to look into this and provide support for above syntax. This would greatly improve maintainability for schemas leveraging interface hierarchies.
The text was updated successfully, but these errors were encountered:
We are using interface hierarchies extensively in our GraphQL schema and encountered an issue with GraphQXL when attempting to override a field's return type in a type implementation. According to the GraphQL specification, it is valid for a field in an implementing type to override the return type of the interface field with a more specific type, provided the new type implements the original return type. However, GraphQXL fails to compile when the spread syntax (
...
) is used, even though this is spec-compliant.Example Schema:
Expected Behavior:
The schema should compile successfully, as overriding
field
withT1
is valid per the GraphQL spec, and the spread syntax should allow inclusion of all other fields from theBase
interface without redundancy.Observed Behavior:
GraphQXL fails to compile when the spread syntax is used, forcing us to manually copy all other fields from the
Base
interface to ensure compatibility.Request you to look into this and provide support for above syntax. This would greatly improve maintainability for schemas leveraging interface hierarchies.
The text was updated successfully, but these errors were encountered: