Skip to content

feat: validate subgraph fetches#124

Draft
lennyburdette wants to merge 1 commit intomainfrom
validate-fetches
Draft

feat: validate subgraph fetches#124
lennyburdette wants to merge 1 commit intomainfrom
validate-fetches

Conversation

@lennyburdette
Copy link
Copy Markdown
Member

This doesn't work yet because operation signatures aren't always valid documents.

@lennyburdette
Copy link
Copy Markdown
Member Author

This is a false negative — the operation signature drops input fields.

storefrontGatewayCancellationSubmit a5eea3
==========================================
https://studio.apollographql.com/graph/xxx/operations?xxx&queryName=storefrontGatewayCancellationSubmit&variant=xxx

💣 Federation 1 supergraph query plan has subgraph fetch nodes that will fail
💣 Federation 2 supergraph query plan has subgraph fetch nodes that will fail
🎉 No difference in query plans

Subgraph fetch errors (Federation 1 supergraph)
-----------------------------------------------
* [service-eng-order-access-gql-federation] Field "CustomerOrderCancellationInput.orderProducts" of required type "[CancellationOrderProductInput!]!" was not provided.
    ```graphql
    mutation storefrontGatewayCancellationSubmit__service_eng_order_access_gql_federation__0 {
      requestCustomerOrderCancellation(customerOrderCancellation: {}) {
        __typename
        formattedRefundAmount
        orderProducts {
          __typename
          id
          status
        }
      }
    }
    ```
* [service-eng-order-access-gql-federation] Field "CustomerOrderCancellationInput.runId" of required type "ID!" was not provided.
    ```graphql
    mutation storefrontGatewayCancellationSubmit__service_eng_order_access_gql_federation__0 {
      requestCustomerOrderCancellation(customerOrderCancellation: {}) {
        __typename
        formattedRefundAmount
        orderProducts {
          __typename
          id
          status
        }
      }
    }
    ```

Subgraph fetch errors (Federation 2 supergraph)
-----------------------------------------------
* [service-eng-order-access-gql-federation] Field "CustomerOrderCancellationInput.orderProducts" of required type "[CancellationOrderProductInput!]!" was not provided.
    ```graphql
    mutation storefrontGatewayCancellationSubmit__service_eng_order_access_gql_federation__0 {
      requestCustomerOrderCancellation(customerOrderCancellation: {}) {
        __typename
        formattedRefundAmount
        orderProducts {
          __typename
          id
          status
        }
      }
    }
    ```
* [service-eng-order-access-gql-federation] Field "CustomerOrderCancellationInput.runId" of required type "ID!" was not provided.
    ```graphql
    mutation storefrontGatewayCancellationSubmit__service_eng_order_access_gql_federation__0 {
      requestCustomerOrderCancellation(customerOrderCancellation: {}) {
        __typename
        formattedRefundAmount
        orderProducts {
          __typename
          id
          status
        }
      }
    }
    ```

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

Successfully merging this pull request may close these issues.

1 participant