#Help with union(enum) Tag Type Mismatch in switch Statement

1 messages · Page 1 of 1 (latest)

turbid fern
#

just do .OperationDefinitionNode instead of grammar.OperationDefinitionNode

#

Also, generally union field names should be snake_case

#

so maybe just like operation instead of OperationDefinitionNode

turbid fern
#

No, it's equivalent to grammar.ExecutableDefinitionNode.OperationDefinitionNode

#

but just using the inferred type is almost always better

#

The error you're getting is because you're referring to the type OperationDefinitionNode, not the field named that on the type ExecutableDefinitionNode (which is another reason it's a good idea to not name your fields the same thing as your types; avoids confusions like this ^^')