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
... to my best knowledge, my idea wouldn't break something for other users
... the documentation does not mention anything about my idea
... there are no open or closed issues that are related to my idea
Description
According to the June 2018 GraphQL spec, the following types may be extended in a GraphQL schema:
Scalars
Objects (type in SDL)
Interfaces
Unions
Enums
InputObjects (input in SDL)
The kotlin.graphql.kickstart.tools.SchemaParser.kt class currently supports extensions of Objects and InputObjects but it does not support extensions for Scalars, Unions, Enums, or Interfaces. The result is that extensions of these types are not respected when constructing the corresponding GraphQLTypes.
This new feature could be modeled after the existing behavior in the SchemaParser that currently separates ObjectTypeExtensionDefinitions and InputObjectTypeExtensionDefinitions.
Add logic to SchemaParser to treat ScalarTypeExtensionDefinitions, UnionTypeExtensionDefinitions, EnumTypeExtensionDefinitions, and InterfaceTypeExtensionDefinitions similar to ObjectTypeExtensionDefinitions and InputObjectTypeExtensions.
Use Cases
Support extending Scalar, Union, Enum, and Interfaces types throughout a schema.
Note: This opportunity for enhancement was discovered while attempting to extend a union type. I have not confirmed the behavior for Scalar, Enum, or Interface types but have included those types in this issue based on code inspection of the SchemaParser class.
Consider the following SDL:
union FooBar = Foo | Bar
extend union FooBar = Baz
The expectation is that FooBar would resolve to Foo | Bar | Baz. However, under the current implementation it resolves to Baz.
The text was updated successfully, but these errors were encountered:
I can confirm that extending the interfaces doesn't work either. As a result, some fields will be missing in the interface definition, which creates bugs at runtime. It would be nice to throw an exception for features that are currently not supported when parsing the schema.
I want to suggest an idea and checked that ...
Description
According to the June 2018 GraphQL spec, the following types may be extended in a GraphQL schema:
The kotlin.graphql.kickstart.tools.SchemaParser.kt class currently supports extensions of Objects and InputObjects but it does not support extensions for Scalars, Unions, Enums, or Interfaces. The result is that extensions of these types are not respected when constructing the corresponding GraphQLTypes.
This new feature could be modeled after the existing behavior in the SchemaParser that currently separates ObjectTypeExtensionDefinitions and InputObjectTypeExtensionDefinitions.
Add logic to SchemaParser to treat ScalarTypeExtensionDefinitions, UnionTypeExtensionDefinitions, EnumTypeExtensionDefinitions, and InterfaceTypeExtensionDefinitions similar to ObjectTypeExtensionDefinitions and InputObjectTypeExtensions.
Use Cases
Support extending Scalar, Union, Enum, and Interfaces types throughout a schema.
Note: This opportunity for enhancement was discovered while attempting to extend a union type. I have not confirmed the behavior for Scalar, Enum, or Interface types but have included those types in this issue based on code inspection of the SchemaParser class.
Consider the following SDL:
The expectation is that FooBar would resolve to Foo | Bar | Baz. However, under the current implementation it resolves to Baz.
The text was updated successfully, but these errors were encountered: