Summary
Generation fails immediately with a JsonSerializationException when the target schema's introspection contains the directive location DIRECTIVE_DEFINITION. This value is a valid member of the GraphQL spec's __DirectiveLocation enum (one of the 12 TypeSystemDirectiveLocation values), but the generator's GraphQlDirectiveLocation enum does not include it, so schema deserialization throws before any code is generated.
Per the GraphQL specification, __DirectiveLocation includes these TypeSystemDirectiveLocation values:
SCHEMA, SCALAR, OBJECT, FIELD_DEFINITION, ARGUMENT_DEFINITION, INTERFACE, UNION, ENUM, ENUM_VALUE, INPUT_OBJECT, INPUT_FIELD_DEFINITION, DIRECTIVE_DEFINITION
DIRECTIVE_DEFINITION is spec-valid and commonly emitted — e.g. the built-in @deprecated directive is valid on it. Any server that reports it will crash the generator during introspection deserialization.
Source:
Version
graphql-client-generator 0.9.31 (0.9.31+5577b29fa4bff48a6e24fbce3bfec8c48a05e101)
Error / stack trace
Unhandled exception: Newtonsoft.Json.JsonSerializationException: Error converting value "DIRECTIVE_DEFINITION" to type 'GraphQlClientGenerator.GraphQlDirectiveLocation'. Path 'data.__schema.directives[2].locations[4]'.
---> System.ArgumentException: Requested value 'DIRECTIVE_DEFINITION' was not found.
at Newtonsoft.Json.Utilities.EnumUtils.ParseEnum(...)
at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(...)
...
at GraphQlClientGenerator.GraphQlHttpUtilities.DeserializeGraphQlSchema(String contentJson)
in /_/src/GraphQlClientGenerator/GraphQlHttpUtilities.cs:line 82
at GraphQlClientGenerator.GraphQlHttpUtilities.RetrieveSchema(...)
in /_/src/GraphQlClientGenerator/GraphQlHttpUtilities.cs:line 75
Summary
Generation fails immediately with a
JsonSerializationExceptionwhen the target schema's introspection contains the directive locationDIRECTIVE_DEFINITION. This value is a valid member of the GraphQL spec's__DirectiveLocationenum (one of the 12TypeSystemDirectiveLocationvalues), but the generator'sGraphQlDirectiveLocationenum does not include it, so schema deserialization throws before any code is generated.Per the GraphQL specification,
__DirectiveLocationincludes theseTypeSystemDirectiveLocationvalues:SCHEMA,SCALAR,OBJECT,FIELD_DEFINITION,ARGUMENT_DEFINITION,INTERFACE,UNION,ENUM,ENUM_VALUE,INPUT_OBJECT,INPUT_FIELD_DEFINITION,DIRECTIVE_DEFINITIONDIRECTIVE_DEFINITIONis spec-valid and commonly emitted — e.g. the built-in@deprecateddirective is valid on it. Any server that reports it will crash the generator during introspection deserialization.Source:
Version
graphql-client-generator0.9.31 (0.9.31+5577b29fa4bff48a6e24fbce3bfec8c48a05e101)Error / stack trace