relay-compiler-language-typescript
relay-compiler-language-typescript copied to clipboard
Boolean types in arguments doesnt generate boolean variables
Logging here so I don't forget.
for the query:
query BlogArticleQuery($isAmp: Boolean!) {
article(slug: "example") {
title(amp: $isAmp) { value }
}
}
should ideally generate as at Relay v9.x:
export type BlogArticleQueryVariables = {
isAmp: boolean;
}
but as at v10
export type BlogArticleQueryVariables = {
isAmp: string;
}
worth also noting that the gql query Relay spits out in ast form is accurate, so this is definitely a bug with the ts langauge.
can you send a fix and add a failing test for this?
I think this is actually blocked by #199 and #196
Once those 2 land, I'll re visit this. Or perhaps, put this issue in as a requirement to land those 2 PR's. Thoughts @sibelius?
Update here, looks like it's actually a bug with our server's (HotChocolate)'s schema generation that is including the built-in scalar types.
So if the schema provided contains scalar Boolean
for example, should the type's generated still be correct? Or is that wrong based on the spec—if im reading it correctly: https://spec.graphql.org/draft/#sec-Scalars.Built-in-Scalars