apollographql / apollo-utils

Monorepo of common utilities related to Apollo and GraphQL
MIT License
36 stars 9 forks source link

persisted-query-lists with apollo codegen throws operation mismatch #433

Open AK3030 opened 4 months ago

AK3030 commented 4 months ago

I am using @apollo/persisted-query-lists with apollo codegen

import type { PersistedQueryManifestConfig } from '@apollo/generate-persisted-query-manifest';
import { fromGraphQLCodegenPersistedDocuments } from '@apollo/generate-persisted-query-manifest';

const config: PersistedQueryManifestConfig = {
  documents: fromGraphQLCodegenPersistedDocuments('./src/gql/persisted-documents.json'),
};

export default config;

however when I use the verification link i get operation mismatch errors on every query. i printed the queries that are being compared by the persisted-query-lists package and it looks like they dont match because the order of fields is different. is there something I can do to fix this issue or is there a bug?

query query GetSupRelationships {
  loggedInShopifyShop {
    id
    relationshipsAsSup(tableFilterInput: {}) {
      edges {
        node {
          id
          hasSupSeenInstantAddUpsellModal
          hasApprovedProposal
          sk {
            id
            name
            __typename
          }
          __typename
        }
        __typename
      }
      __typename
    }
    __typename
  }
}
 manifestoperation query GetSupRelationships {
  loggedInShopifyShop {
    id
    relationshipsAsSup(tableFilterInput: {}) {
      edges {
        node {
          hasApprovedProposal
          hasSupSeenInstantAddUpsellModal
          id
          sk {
            id
            name
            __typename
          }
          __typename
        }
        __typename
      }
      __typename
    }
    __typename
  }
}
jerelmiller commented 4 months ago

Hey @AK3030 👋

I'll do my best to take a look at this soon. Thanks for reporting!