-
Notifications
You must be signed in to change notification settings - Fork 468
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
Apollo does not support anonymous operations #184
Comments
Yes, we need to name the types we generate so we can't really support anonymous queries. |
so the example in the code - or perhaps you could randomize some name? like heroku? i think that in my usecase - simply grabbing the first parameter and throwing it as the name / would suffice. Then instead of an error - just throw a warning.
|
You really MUST report file name where the error happened. |
@rricard Do you think we can re-open this issue in light of @langpavel's comment that we need to report the file name where the error occurred. Checking every query manually is an unreasonable solution to this |
I was able to debug this by adding temporary logs to the file where the issue was being raised (not the ideal, but it worked for me):
Document will give you information about the file being evaluated so you will be able to solve the issue! |
In my case the error was coming from an old commented out query and I had to remove the comment to get it to work. I was only able to discover this after adding console logging like @giovannibenussi suggested. Would have been a bit easier if there was more information in the output.
|
Any update on adding tracing so that we can tell which line number, or at least file, is causing the error? |
Can we add this tracing? As simple as @giovannibenussi console logging would help a tremendous amount. |
The other side of the coin here is what if we just want to skip anonymous operations? |
version: apollo-codegen 0.15.2
i execute query in graphiql
query { getAllCustomers {id} }
i gets data.getAllCustomers[ids...]
then i want to execute query under apollo-client/angular-apollo
so i continue with codegen
schema/json/js
i have only one .gql file with the same query like i executed in graphiql:
query { getAllCustomers {id} }
but schema.ts wont genrate with error
Update
if found problem query withink works in graphql-tag and gprahiql wont generate type script to solve above problem is add
then apolo codegen will generate
The text was updated successfully, but these errors were encountered: