Open madebyfabian opened 1 year ago
@madebyfabian I would like to ask if this module is currently working properly?
@awdr74100 Hi, yes for me, everything works, except of Fragments. But I am not using the nuxt-graphql-server module like you described in #369.
@madebyfabian Thank you very much for your reply! I thought everyone could use the nuxt-graphql-server module except me...
@madebyfabian fragments are working fine for me.. How are you setting them up?
The docs are very vague on this.. You have to create a fragments
folder inside the queries
folder. Then they would be set up like this:
fragment Image on Image {
id
altText
height
width
url (transform: {
maxHeight: 600,
maxWidth: 400,
crop: CENTER
})
}
Then add them into your .gql
queries with no import such as this:
image {
...Image
}
Hope this helps:)
@rylanharper Thanks for the details! This should absolutely be in the docs, since it's not standard graphql-ish behaviour. Now it's working.
Issue was: I named my fragment files MyFragment.fragment.gql
to distinguish them easily from queries. Doing this does not work though.
If I find some time I'll create a docs PR.
Your use case
Hi there! Thanks for this module. I was inspecting my builds and I see that
graphql
gets bundled in there. I see that this module only uses theimport { parse } from 'graphql'
(https://github.com/search?q=repo%3ADiizzayy%2Fnuxt-graphql-client%20from%20%27graphql%27&type=code)In my understanding, this method should only be needed while building. Or does this module read the
.gql
files in runtime from the server?I see that it adds a good amount of KB's to my build:
The solution you'd like
If it's possible, remove this dependency in production builds.
Possible alternatives
No response
Additional information
Similar issue: https://github.com/urql-graphql/urql/issues/307