fragment OperationData on OperationCollectionEntry {
    name
    currentOperationRevision {
      body
      headers {
        name
        value
      }
      variables
    }
}

query OperationCollectionQuery($operationCollectionId: ID!) {
    operationCollection(id: $operationCollectionId) {
        __typename
        ... on OperationCollection {
            operations {
                lastUpdatedAt
                id
                ...OperationData
            }
        }
        ... on NotFoundError {
            message
        }
        ... on PermissionError {
            message
        }
        ... on ValidationError {
            message
        }
    }
}

query OperationCollectionPollingQuery($operationCollectionId: ID!) {
    operationCollection(id: $operationCollectionId) {
        __typename
        ... on OperationCollection {
            operations {
                lastUpdatedAt
                id
            }
        }
        ... on NotFoundError {
            message
        }
        ... on PermissionError {
            message
        }
        ... on ValidationError {
            message
        }
    }
}

query OperationCollectionDefaultQuery($graphRef: ID!) {
    variant(ref: $graphRef) {
        __typename
        ... on GraphVariant {
          mcpDefaultCollection {
            __typename
            ... on OperationCollection {
              operations {
                lastUpdatedAt
                id
                ...OperationData
              }
            }
            ... on PermissionError {
              message
            }
          }
        }
        ... on InvalidRefFormat {
            message
        }
    }
}

query OperationCollectionDefaultPollingQuery($graphRef: ID!) {
    variant(ref: $graphRef) {
        __typename
        ... on GraphVariant {
          mcpDefaultCollection {
            __typename
            ... on OperationCollection {
              operations {
                id
                lastUpdatedAt
              }
            }
            ... on PermissionError {
              message
            }
          }
        }
        ... on InvalidRefFormat {
            message
        }
    }
}

query OperationCollectionEntriesQuery($collectionEntryIds: [ID!]!) {
  operationCollectionEntries(collectionEntryIds: $collectionEntryIds) {
    id
    lastUpdatedAt
    ...OperationData
  }
}