-
Notifications
You must be signed in to change notification settings - Fork 492
Add loader for .graqhql files #270
base: master
Are you sure you want to change the base?
Conversation
33f23ff
to
6bd2327
Compare
Can somebody from maintainers look at this pull request Please? @DorianGrey, @wmonk |
Yes, need this please. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very sorry for this delayed reponse - I've been quite busy the last couple of weeks and didn't have the time to look into this as precisely as it deserves.
Most things are looking fine, apart from the two issues mentioned (where only one is critical).
Side note: @wmonk , even though this would be "pre-picking" of a CRA 2.x feature, I suppose it's not that unlikely, esp. since it cuts down a bit of merging work for that version ... ;)
// The GraphQL loader preprocesses GraphQL queries in .graphql files. | ||
{ | ||
test: /\.(graphql)$/, | ||
loader: 'graphql-tag/loader', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any particular reason that this loader is only registered in dev
, but not in prod
mode? (See the webpack.config.prod.js
)
@@ -677,6 +678,34 @@ Please be advised that this is also a custom feature of Webpack. | |||
**It is not required for React** but many people enjoy it (and React Native uses a similar mechanism for images).<br> | |||
An alternative way of handling static assets is described in the next section. | |||
|
|||
## Adding GraphQL files | |||
|
|||
> Note: this feature is available with [email protected] and higher. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suppose this note is not required here, since this PR results in some kind of "pre-picking".
Hi, @patrick91 Are you still working on this pr? If not, I would like to make a pr again, cuz I need it for my project. Thank you |
I'll finish this in the weekend if that's ok :) |
Yop. No problem. Thank you for this pr!! 😀 |
Any progress on this? |
4f61b6b
to
0914932
Compare
Sorry folks! I was travelling, I just pushed the changes, thanks for the nudges @eddiemoore @simsim0709 :) @DorianGrey this should be fine to merge now, as soon as I fix the failure on travis ci :) |
0914932
to
d3716d5
Compare
Ok, I'm not sure why it fails, @DorianGrey can you tell me how to run the single failing test locally? I had troubles with docker unfortunately |
You may just run The particular test that seems to fail in your case is this one: https://github.com/wmonk/create-react-app-typescript/blob/master/tasks/e2e-kitchensink.sh#L144 |
@DorianGrey yeah, I saw that, I was able to run the kitchensink locally but with no luck, it seems like it using an old version of the scripts, I even tried to delete the config and it didn't break, mmh, let me try again |
ad4613d
to
d3716d5
Compare
@DorianGrey it seems that we need to pass
so it will load the correct scripts, but the test fails still, with a different failure
|
Hm... I'm not sure about adding this, since |
Yup, but without it we are testing the wrong scripts right? I'm happy to do another PR with the updated tests if that's ok :) |
The It might take a little more to set this up properly, i.e. not only modifying the generation command, but the whole particular template. PR is welcome, though 👍 |
Hi, I have been trying to figure out how to use .graphql files in create-react-app-typescript. My investigations have led me to this PR - was support for loading .graphql ever implemented? Are there any workarounds available? My main reason for switching from .ts files using gql`` is so that I can easily use fragments. |
Closes #269
See: facebook/create-react-app#3909