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

Make the error messages include the location of the cause #304

Closed
boosh opened this issue Sep 12, 2015 · 4 comments
Closed

Make the error messages include the location of the cause #304

boosh opened this issue Sep 12, 2015 · 4 comments

Comments

@boosh
Copy link

boosh commented Sep 12, 2015

I'm getting this error in the following fragment:

  fragments: {
    viewer: () => Relay.QL`
      fragment on Viewer {
        ${StatusMutation.getFragment('viewer')}
        calendar(id: $meetingId) {
          id
        }
      }
    `,
  },

I've tried changing my use of getFragment to all of the following as per the error, none of which have worked:

${StatusMutation.getFragment('viewer')}       // don't know why this doesn't work
`${StatusMutation.getFragment('viewer')}`       // didn't expect this to work
${Child.getFragment('viewer')}       // didn't expect this to work
`${Child.getFragment('viewer')}`       // didn't expect this to work

So whatever this error message means, its suggested fix is incorrect and confusing. Please try to make it more descriptive. Thanks.

@boosh
Copy link
Author

boosh commented Sep 12, 2015

That's one thing with the error messages - it's not very clear exactly where the cause is. I.e. the messages might say what is wrong, but you have to hunt around to try to find exactly which bit of code is responsible. Is there some way for error messages to include the file name & line that triggered them, or at least the component name or something?

Well I guess you can see this in the stack trace, but I still can't find how to fix this....

@boosh boosh changed the title Make the error Invariant Violation: RelayQL: Invalid fragment composition, use ${Child.getFragment('name')}. more descriptive Make the error messages include the location of the cause Sep 12, 2015
@josephsavona
Copy link
Contributor

@boosh what is the exact error message that you're getting? Invariant Violation: RelayQL: Invalid fragment composition, use ${Child.getFragment('name')}. ?

Are you sure that StatusMutation.getFragment('viewer') is returning a non-null value?

@yungsters
Copy link
Contributor

Ping @boosh.

@boosh
Copy link
Author

boosh commented Oct 12, 2015

I can't reproduce this now. It was probably fixed by upgrading to 0.3.2, I'm not sure. I'm about to restart work on the client again once I've put the finishing touches to the server. If I run into this issue again I'll reopen this issue with more details.

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

3 participants