apollographql / apollo-studio-community

🎡  GraphQL developer portal featuring an IDE (Apollo Explorer), auto-documentation, metrics reporting, and more. This repo is for issues, feature requests, and preview docs. 📬
https://studio.apollographql.com
249 stars 29 forks source link

Apollo Studio Explorer generates invalid variables for required (non-null) arguments (input fields) #190

Closed FluorescentHallucinogen closed 2 years ago

FluorescentHallucinogen commented 2 years ago

Context: https://twitter.com/alexey_rodionov/status/1284118554024050688

apollo-studio-explorer

Current behavior: Apollo Studio Explorer fill outs the null value for required (non-null) arguments (input fields) as default variable value.

Expected behavior: Apollo Studio Explorer fill outs the "" for strings, 0 for ints and floats, [] for arrays, etc. as default variable value.

daniman commented 2 years ago

Hey @FluorescentHallucinogen, I believe this is a duplicate of the request in #163 so I'm going to close this issue. 😄 It seems like this is a preference that could go both ways. The value of keeping null is that it points you towards required action. The value of generating valid variables is that then you can run your query. I don't think we have enough data yet to change the current behavior, though the more folks who share their preference with us, the better.