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

Case-sensitive filename cause errors with operation name #29

Closed
sgrove opened this issue Apr 8, 2020 · 3 comments
Closed

Case-sensitive filename cause errors with operation name #29

sgrove opened this issue Apr 8, 2020 · 3 comments

Comments

@sgrove
Copy link

sgrove commented Apr 8, 2020

Given I have a file tempTest.re (notice the lowercase prefix) with this operation:

module WhateverThisIsQuery = [%relay.query
  {|
     query TempTest_WhateverThisIsQuery($blah: ID!) {
    gitHub {
      node(id: $blah) {
        __typename
        ... on GitHubRepository {
          nameWithOwner
        }
      }
    }
  }
|}
];

Because of the capitalization mismatch, I'll get this error from the reason-relay compiler:

Watching for changes to re...
ERROR:
Parse error: Error: RelayFindGraphQLTags: Operation names in graphql tags must be prefixed with the module name and end in "Mutation", "Query", or "Subscription". Got `TempTest_WhateverThisIsQuery` in module `tempTest`. in "components/tempTest.re"

If I then change the operation name to make the reason-relay compiler happy, then bucklescript will give me this error:

  We've found a bug for you!
  /Users/s/src/egghead/egghead-static/src/components/tempTest.re 112:3-123:2

  110 │
  111 │ module WhateverThisIsQuery = [%relay.query
  112 │   {|
  113 │      query tempTest_WhateverThisIsQuery($blah: ID!) {
    . │ ...
  122 │   }
  123 │ |}
  124 │ ];
  125 │

  The module or file tempTest_WhateverThisIsQuery_graphql can't be found.
@zth
Copy link
Owner

zth commented Apr 9, 2020

I hope this is fixed in 212965b , I'll let you know when there's a testable new release.

@zth
Copy link
Owner

zth commented Apr 9, 2020

@sgrove this should be fixed in the latest version. Can you confirm?

@sgrove
Copy link
Author

sgrove commented Apr 12, 2020

Looks like it works, thank you!

@sgrove sgrove closed this as completed Apr 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants