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

Enum values provided to scalars #834

Closed
goto-bus-stop opened this issue Feb 14, 2024 · 0 comments · Fixed by #835
Closed

Enum values provided to scalars #834

goto-bus-stop opened this issue Feb 14, 2024 · 0 comments · Fixed by #835
Assignees
Labels
apollo-compiler issues/PRs pertaining to semantic analysis & validation bug Something isn't working

Comments

@goto-bus-stop
Copy link
Member

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.

@goto-bus-stop goto-bus-stop added bug Something isn't working apollo-compiler issues/PRs pertaining to semantic analysis & validation labels Feb 14, 2024
@goto-bus-stop goto-bus-stop self-assigned this Feb 14, 2024
goto-bus-stop added a commit that referenced this issue Feb 14, 2024
…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 added a commit that referenced this issue Feb 14, 2024
…m scalars, fixes #834 (#835)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apollo-compiler issues/PRs pertaining to semantic analysis & validation bug Something isn't working
Projects
None yet
1 participant