microsoft / graphitation

GraphQL tooling & runtime support needed for MS Teams and beyond
https://microsoft.github.io/graphitation/
MIT License
137 stars 30 forks source link

Make decodeASTSchema correctly decode encoded Booleans #389

Closed Markionium closed 5 months ago

Markionium commented 5 months ago

The following schema encodes correctly.

type Query {
    person(id: Int!): Person
  }
  type Person {
    name: String!
    phones(includeDefault: Boolean = true): [String!]!
  }

However when trying to decode it it will throw reach the invariant and throw an error.

Unexpected value for type Boolean: true

This PR adds a test case for this case and fixes the decoding.

In addition I changed the test case name to be the correct name.