Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Boolean types in arguments doesnt generate boolean variables #198

Open
maraisr opened this issue Jul 24, 2020 · 3 comments
Open

Boolean types in arguments doesnt generate boolean variables #198

maraisr opened this issue Jul 24, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@maraisr
Copy link
Member

maraisr commented Jul 24, 2020

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.

@sibelius sibelius added the bug Something isn't working label Jul 24, 2020
@sibelius
Copy link
Contributor

can you send a fix and add a failing test for this?

@maraisr
Copy link
Member Author

maraisr commented Jul 27, 2020

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?

@maraisr
Copy link
Member Author

maraisr commented Oct 19, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants