evenchange4 / graphql.macro

Compile GraphQL AST at build-time with babel-plugin-macros.
MIT License
239 stars 21 forks source link

Latest version only sends fragments to the server #95

Open mxstbr opened 5 years ago

mxstbr commented 5 years ago

For some reason when using the latest v1.4.1, the client only sends the fragments to the server but not the query:

export const GetThreadDocument = gql`
  query getThread($id: ID!) {
    thread: node(id: $id) {
      ...thread
      ...threadParticipants
    }
  }
  ${threadFragmentDoc}
  ${threadParticipantsFragmentDoc}
`;

results in only the threadFragmentDoc and the threadParticipantsFragmentDoc being sent to the server.

evenchange4 commented 5 years ago

Oh, @mxstbr thanks you for testing it so quickly. As I https://github.com/evenchange4/graphql.macro/issues/90#issuecomment-494220259 below the origin issue , it should be fixed with version v1.4.2. Could you test it again?

lanwin commented 4 years ago

I currently have exactly the opposite problem. The generated DocumentNode only contains the Source for the Query itself but no the fragments. While the definitions list also contains the fragments.