Skip to content

Sample for INPUT_FIELD_DEFINITION directive not working #241

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

Closed
williamwjs opened this issue Jan 17, 2023 · 1 comment
Closed

Sample for INPUT_FIELD_DEFINITION directive not working #241

williamwjs opened this issue Jan 17, 2023 · 1 comment

Comments

@williamwjs
Copy link

williamwjs commented Jan 17, 2023

Here's the sample schema as in https://github.com/graphql-java-kickstart/samples/blob/master/directives/src/main/resources/schema.graphqls#L1-L19

directive @range(
    min: Float!,
    max: Float!
) on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION

type Query {
    withInput(input: InputObject): Float
}

input InputObject {
    value: Float @range(min: 0.00, max: 10.00)
    nolimit: Float
    limit: Float @range(min: 11.00, max: 15.00)
}

Here's the example query

{
  withInput(input: {value: 100})
}

Expected result:
Render as error stating that the input value is not within 0-10

Actual result:

{
  "data": {
    "withInput": 100
  }
}
@williamwjs
Copy link
Author

williamwjs commented Jan 18, 2023

Closing this one and raising as graphql-java-kickstart/graphql-java-tools#731 instead

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

No branches or pull requests

1 participant