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

Globs in file-specs don't understand ** #167

Closed
Dreamacro opened this issue Jan 27, 2022 · 1 comment · Fixed by #330
Closed

Globs in file-specs don't understand ** #167

Dreamacro opened this issue Jan 27, 2022 · 1 comment · Fixed by #330
Labels
enhancement New feature or request

Comments

@Dreamacro
Copy link

Describe the bug
When glob matching with the root directory, go generate ./... fails

output

$ go generate ./...
no queries found, looked in: **/*.graphql (configure this in genqlient.yaml)
exit status 1

To Reproduce

schema: ../../graphql/schema.graphql

operations:
  - './**/*.graphql'

generated: ./repo/pkg/generated.go

package: pkg

workaround (success)

schema: ../../graphql/schema.graphql

operations:
  - './repo/**/*.graphql'
  - './route/**/*.graphql'

generated: ./repo/pkg/generated.go

package: pkg

genqlient version
main branch

@Dreamacro Dreamacro added the bug Something isn't working label Jan 27, 2022
@benjaminjkraft
Copy link
Collaborator

benjaminjkraft commented Jan 27, 2022

Ah, the problem is that Go's Glob doesn't support **. I suppose we could switch to another library, or hack in support (i.e. bring back in the code in #134 which I removed in #137 because it was inconsistent); it sounds like in your case a fixed depth (2) worked, but it's not an unreasonable desire to say "use all the GraphQL files in my repo".

@benjaminjkraft benjaminjkraft added enhancement New feature or request and removed bug Something isn't working labels Jan 27, 2022
@benjaminjkraft benjaminjkraft changed the title Glob bug on genqlient.yaml operations Globs in file-specs don't understand ** Jan 27, 2022
benjaminjkraft added a commit that referenced this issue Apr 5, 2024
It's really quite reasonable to want this to work -- you want to say to
look for queries in `pkg/**/*.graphql`, or `**/queries/*.graphql`, or
whatever. Now it does. I picked `doublestar` because it seemed a
reasonable combination of popular and well-documented.

Fixes #167. Hopefully obsoletes #327.

I have:
- [x] Written a clear PR title and description (above)
- [x] Signed the [Khan Academy CLA](https://www.khanacademy.org/r/cla)
- [x] Added tests covering my changes, if applicable
- [x] Included a link to the issue fixed, if applicable
- [x] Included documentation, for new features
- [x] Added an entry to the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants