dotansimha / graphql-tools-rs

40 stars 3 forks source link

Basic types throwing errors known_type errors during validation #46

Open allancalix opened 2 years ago

allancalix commented 2 years ago

Summary

Query inputs throw "Unknown type \"String\"." for all basic types. It seems as though the basic scalars are not included in the schema after being parsed. Defining the scalars explicitly in the schema seems to resolve the issue:

scalar Boolean
scalar Float
scalar Int
scalar ID
scalar String

Not sure whether this is expected or not as this doesn't happen in the rules tests because the scalars are explicitly defined in the introspection schema here.

Observed behavior

validate(&schema, &query, &default_rules_validation_plan) # => `"Unknown type \"String\"."` for all basic types.

Expected behavior

Basic types are valid in query input arguments