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

Catch ‘Error writing to store caused by same queries without ID’ #2185

Closed
mhuconcern opened this issue Jul 17, 2019 · 5 comments
Closed
Labels
waiting-for-answer Waiting for answer from author

Comments

@mhuconcern
Copy link

Is your feature request related to a problem? Please describe.
apollographql/apollo-client#2510

Apollo codegen catches this issue, It would be nice to have to catch this before it fails on production.
Describe the solution you'd like

Throw warning on code generation

@dotansimha
Copy link
Owner

@mhuconcern Can you please add more details on this issue? and point us to an example?

@dotansimha dotansimha added the waiting-for-answer Waiting for answer from author label Jul 24, 2019
@mhuconcern
Copy link
Author

mhuconcern commented Jul 25, 2019

Example
Query 1 :

query getOrganizationUsers($id: ID!) {
     organization(id: $id) {
      id
      user
     }
}

Query 2:

query getOrganizationRegions($id: ID!) {
     organization(id: $id) {
        region
     }
}

It would be nice if the generation process would throw a warning saying that id is missing in query 2. Apollo codegen catches this issue during the generation process.

@dotansimha
Copy link
Owner

Hi @mhuconcern , Apollo does that because it requires id to function properly. The codegen doesn't require that, and I think it's out of the codegen scope.
@ardatan @kamilkisiela what do you think?

@ardatan
Copy link
Collaborator

ardatan commented Aug 5, 2019

@dotansimha Having this kind of feature inside an IDE plugin would be better in my opinion.

@dotansimha
Copy link
Owner

Closing for now. If this is relevant for more developers, please feel free to comment here and we'll consider to re-open and implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-answer Waiting for answer from author
Projects
None yet
Development

No branches or pull requests

3 participants