Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Extracting from JS fails with "unhandled promise rejection" #20

Closed
jlengstorf opened this issue Apr 15, 2017 · 2 comments · Fixed by #21
Closed

Extracting from JS fails with "unhandled promise rejection" #20

jlengstorf opened this issue Apr 15, 2017 · 2 comments · Fixed by #21

Comments

@jlengstorf
Copy link
Contributor

I’m getting an error I’m not sure how to start debugging when trying to run persistgraphql on gql-tagged queries in a project:

$ persistgraphql src/client/containers/Test.js --add_typename
Using the add-typename query transformer.
(node:26286) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): GraphQLError: Syntax Error GraphQL (1:1) Unexpected <EOF>

1:
   ^

(node:26286) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I stripped down the file to make sure it wasn’t something else in my code:

import { gql } from 'react-apollo';

const QueryOne = gql`
  query TestQuery($id: String) {
    test(id: $id) {
      id
      name
    }
  }
`;

export default {
  QueryOne,
};

After looking through the tests, I believe this should work, so I’m not sure how or where this is failing. If this is a bug and not an issue with how I'm using it, I'm happy to contribute — just need a pointer to how I might start debugging.

Thanks!

@larixer
Copy link

larixer commented Apr 15, 2017

@jlengstorf The command line should be:

$ persistgraphql src/client/containers/Test.js --js --add_typename --extension=js

Not very intuitive, right? :)

jlengstorf added a commit to jlengstorf/persistgraphql that referenced this issue Apr 17, 2017
@jlengstorf
Copy link
Contributor Author

@Vlasenko Thanks for the clarification! I just submitted #21 to clarify usage in the README for newbies like me in the future. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants