Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler): accept enum value (unquoted string) as input for custom scalars #835

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

goto-bus-stop
Copy link
Member

@goto-bus-stop goto-bus-stop commented Feb 14, 2024

Validation does not currently accept something like this:

scalar Currency
type Query {
  convertToUSD(amount: Int!, currency: Currency!): Int!
}

query {
  convertToUSD(amount: 100, currency: EUR)
}

which is accepted by graphql-js and (rarely) used by customers. I don't love it, but we already accept enum values nested inside lists or objects as input for custom scalars, so it makes sense to accept this too.

Fixes #834

…m scalars, fixes #834

Validation does not currently accept something like this:

```graphql
scalar Currency
type Query {
  convertToUSD(amount: Int!, currency: Currency!): Int!
}

query {
  convertToUSD(amount: 100, currency: EUR)
}
```

which is accepted by graphql-js and (rarely) used by customers. I don't love it, but we already accept enum values nested inside lists or objects as input for custom scalars, so it makes sense to accept this too.
@goto-bus-stop goto-bus-stop changed the title fix(compiler): accept enum value (unquoted string) as input for custom scalars, fixes #834 fix(compiler): accept enum value (unquoted string) as input for custom scalars Feb 14, 2024
Copy link
Member

@lrlna lrlna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank youuu

@goto-bus-stop goto-bus-stop merged commit 3b180d9 into main Feb 14, 2024
12 checks passed
@goto-bus-stop goto-bus-stop deleted the renee/enum-value-as-scalar branch February 14, 2024 11:02
@goto-bus-stop goto-bus-stop mentioned this pull request Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enum values provided to scalars
2 participants