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

defaultValue false and null not shown in doc-viewer #1652

Closed
Migushthe2nd opened this issue Aug 30, 2021 · 2 comments · Fixed by #1693
Closed

defaultValue false and null not shown in doc-viewer #1652

Migushthe2nd opened this issue Aug 30, 2021 · 2 comments · Fixed by #1693
Labels

Comments

@Migushthe2nd
Copy link
Contributor

Describe the bug
The schema can include default values for query arguments. The doc-viewer shows this value next to the query argument name. In the case of false and null this does not happen. In the introspection query, default values are always sent as a string:

  • not set ->"defaultValue": null
  • null -> "defaultValue": "null"
  • false -> "defaultValue": "false"

I think this is the current code that is used to parse the incoming value:

const defaultValue = inputValueIntrospection.defaultValue
? valueFromAST(parseValue(inputValueIntrospection.defaultValue), type)
: undefined;

To Reproduce
Steps to reproduce the behavior:

  1. Set the default value of a graphql query argument in the schema to null or false
  2. Connect to the API
  3. See no indication that the default value is null or false

Expected behavior
The doc-viewer shows the default value as null or false

Screenshots
true:
image
false:
image
null:
image

Desktop:

  • Platform: desktop app, but should apply to all
  • Version: 4.0.9.0
@imolorhe
Copy link
Collaborator

Thanks for reporting this! I'd look into it as soon as I can. Note if you identify the issue, you can always create a PR. That way it can be resolved faster, otherwise I'll try to take a look when I can

@Migushthe2nd
Copy link
Contributor Author

Seems to be fixed in the arguments list
image

However, not yet in the fields list
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants