-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
@parcel/transformer-graphql: Only executable definitions are supported in GraphQL Documents. #8461
Comments
i would guess: parcel graphql transformer can only parse operations (mutations, queries, subscriptions) and not input type or fragment definitions, yet. In your case i would use something more stable for graphql files, like https://www.graphql-cli.com/codegen/ for now. define your graphql files -> execute the code generation and just import the generated hooks, types and so on. |
Thanks for the suggestion, I tried graphql-cli, but it gives another error and that library is not being actively maintained. Urigo/graphql-cli#1807 To cross check if it's my code issue, I tried Vite.js 3 bundler and my .graphql file works fine with it. |
Sorry I sent you the wrong link
I ment https://github.com/dotansimha/graphql-code-generator
vbutani ***@***.***> schrieb am Fr., 16. Sept. 2022, 15:44:
… i would guess: parcel graphql transformer can only parse operations
(mutations, queries, subscriptions) and not input type or fragment
definitions, yet.
In your case i would use something more stable for graphql files, like
https://www.graphql-cli.com/codegen/ for now. define your graphql files
-> execute the code generation and just import the generated hooks, types
and so on.
Thanks for the suggestion, I tried graphql-cli, but it gives another error
and that library is not being actively maintained. Urigo/graphql-cli#1807
<Urigo/graphql-cli#1807>
To cross check if it's my code issue, I tried Vite.js 3 bundler and my
.graphql file works fine with it.
—
Reply to this email directly, view it on GitHub
<#8461 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARI4YDZYEOSVRN3BOR2ONTV6R2U7ANCNFSM6AAAAAAQJOQSWY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This code generator works, but I am not using Typescript in my project and sorry for lack of my knowledge as I am not getting how this code generator will help me resolve the parcel graphql transformer error? |
The idea was that you can write graphql files, but you do not have to
import them.
So no need to use graphql transformer ;-).
But I do not know your exact setup. So it was just an idea.
In some of my typescript projects i use it to generate my schemes and types
+ angular providers and react hooks.
So you have js/ts files you can import, which parceljs is able to bundle
and optimize.
vbutani ***@***.***> schrieb am Fr., 16. Sept. 2022, 22:46:
… Sorry I sent you the wrong link I ment
https://github.com/dotansimha/graphql-code-generator vbutani *@*.
*> schrieb am Fr., 16. Sept. 2022, 15:44: … <#m_2491856110758750672_> i
would guess: parcel graphql transformer can only parse operations
(mutations, queries, subscriptions) and not input type or fragment
definitions, yet. In your case i would use something more stable for
graphql files, like https://www.graphql-cli.com/codegen/
<https://www.graphql-cli.com/codegen/> for now. define your graphql files
-> execute the code generation and just import the generated hooks, types
and so on. Thanks for the suggestion, I tried graphql-cli, but it gives
another error and that library is not being actively maintained.
Urigo/graphql-cli#1807 <Urigo/graphql-cli#1807>
<Urigo/graphql-cli#1807 <Urigo/graphql-cli#1807>>
To cross check if it's my code issue, I tried Vite.js 3 bundler and my
.graphql file works fine with it. — Reply to this email directly, view it
on GitHub <#8461 (comment)
<#8461 (comment)>>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AARI4YDZYEOSVRN3BOR2ONTV6R2U7ANCNFSM6AAAAAAQJOQSWY
<https://github.com/notifications/unsubscribe-auth/AARI4YDZYEOSVRN3BOR2ONTV6R2U7ANCNFSM6AAAAAAQJOQSWY>
. You are receiving this because you commented.Message ID: @.*>
This code generator works, but I am not using Typescript in my project and
sorry for lack of my knowledge as I am not getting how this code generator
will help me resolve the parcel graphql transformer error?
—
Reply to this email directly, view it on GitHub
<#8461 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARI4YBF2NWCQ72YL2LQINDV6TMCJANCNFSM6AAAAAAQJOQSWY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I am still facing the same issue. |
Ended up here because I got the same error. I'll continue looking, however I noticed that there seem to be an error in your graphql query:
I'm wondering if the parcel plugin just emits an unhelpful error. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
I am trying to migrate my frontend react project from webpack to Parcel 2, but stuck with following GraphQL error and not getting help around it, please advise.
@parcel/transformer-graphql: Only executable definitions are supported in GraphQL Documents.
package versions:
"graphql": "^15.8.0",
"graphql-tag": "^2.12.6",
"@parcel/transformer-graphql": "^2.7.0",
"@parcel/transformer-sass": "^2.7.0",
"parcel": "latest"
The .graphql file which gives an error is as follows:-
add-product.graphql
mutation AddProduct($id: String!, $comnId: [String!]!, $products: [AuthorizeProduct!]!, $pSalesLevel: String){
authorizeProduct(id: $routeEnvId, comnId: $comnId, products: $products, pSalesLevel: $pSalesLevel) {
authorizeProductStatuses {
error
routeEnvId
arloComb
productId
fiscalWeekIds
}
}
}
input AuthorizeProduct {
productId: Int!
fiscalWeekIds: [Int!]!
}
The text was updated successfully, but these errors were encountered: