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

[bug]: Unable to create subfolders inside queries folder #1108

Closed
1 of 6 tasks
Jordaneisenburger opened this issue Apr 3, 2019 · 6 comments
Closed
1 of 6 tasks

[bug]: Unable to create subfolders inside queries folder #1108

Jordaneisenburger opened this issue Apr 3, 2019 · 6 comments
Labels
bug Something isn't working help wanted Eligible for community contribution.

Comments

@Jordaneisenburger
Copy link
Member

Describe the bug
Right now it's not possible to create a subfolder inside the venia-concept/src/queries the reason you might wanna do this is to better structure your queries.

For example you might wanna create a subfolder like venia-concept/src/queries/category that contains all queries related to the category.

To Reproduce
Steps to reproduce the behavior:

  1. Create venia-concept/src/queries/category and keep it empty for now.
  2. Run yarn run build.
  3. run yarn run watch:venia
  4. See error Error: EISDIR: illegal operation on a directory, read

Expected behavior
No error and the watch command just continues to run as usual

Possible solutions
Some globbing should be added to PWADevServer.js on line 177 so instead of just returning the direct .graphql files it should search recursive. This could be done with just plain JS but there seems to be a good package for this see https://github.com/isaacs/node-glob

Please complete the following device information:

  • Device [Macbook pro]:
  • OS Mojave 10.14.4 Beta (18E215a)
  • Magento Version: default from .env.dist
  • PWA Studio Version: [develop][v2.1.0]
  • NPM version 6.5.0:
  • Node Version v11.9.0:

Please let us know what packages this bug is in regards to:

  • venia-concept
  • pwa-buildpack
  • peregrine
  • pwa-devdocs
  • upward-js
  • upward-spec
@Jordaneisenburger Jordaneisenburger added the bug Something isn't working label Apr 3, 2019
@Jordaneisenburger
Copy link
Member Author

Jordaneisenburger commented Apr 4, 2019

Not sure if this is a bug because there might be a reason to not structure your query files that I'm not aware of. But if this is in fact a bug i'd like to take ownership

@awilcoxa
Copy link

@zetlen

@supernova-at
Copy link
Contributor

I don't see any technical reason why we shouldn't do this and node-glob seems a sensible solution to me 👍.

I'm cool if @Jordaneisenburger makes this improvement for sure.

@awilcoxa awilcoxa added the help wanted Eligible for community contribution. label Jul 24, 2019
@Jordaneisenburger
Copy link
Member Author

Problem seems to have been resolved. Check second last query file
image

@zetlen
Copy link
Contributor

zetlen commented Aug 9, 2019

Excellent! Now that #1498 is merged and the configureWebpack function takes a special flag for graphqlQueries, I'd like to ask @Jordaneisenburger if it still works. It should now be driven by the presence of a file path in the UPWARD file, rather than a particular directory like queries.

@Jordaneisenburger
Copy link
Member Author

@zetlen it still works after the merge, well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Eligible for community contribution.
Projects
None yet
Development

No branches or pull requests

4 participants