Skip to content

Update GraphQLResponse.swift - #3640

Closed
bobbysothebys wants to merge 1 commit into
apollographql:mainfrom
bobbysothebys:patch-1
Closed

Update GraphQLResponse.swift#3640
bobbysothebys wants to merge 1 commit into
apollographql:mainfrom
bobbysothebys:patch-1

Conversation

@bobbysothebys

Copy link
Copy Markdown

/// An error representing an invalid or unusable GraphQLResponse. ///
/// This error is thrown by convenience APIs such as GraphQLResponse/dataOrThrow() when the /// response does not contain usable data.
///
/// A response may fail for one of two reasons:
/// - graphQLErrors(_:): The server returned one or more GraphQL errors and no data was
/// available to return.
/// - missingData: The response contained neither data nor GraphQL errors.
///
/// This error only describes invalid GraphQL response state. Transport-level failures, request
/// execution failures, and other networking errors are surfaced separately by the network transport
/// and request chain APIs.
public enum Error: Swift.Error, Sendable {
/// The response included one or more GraphQL errors and did not contain usable data.
case graphQLErrors([GraphQLError])

/// The response contained neither data nor GraphQL errors.
case missingData
}

Similar to Kotlins dataOrThrow or dataAssertNoErrors

/// An error representing an invalid or unusable ``GraphQLResponse``.
///
/// This error is thrown by convenience APIs such as ``GraphQLResponse/dataOrThrow()`` when the
/// response does not contain usable `data`.
///
/// A response may fail for one of two reasons:
/// - ``graphQLErrors(_:)``: The server returned one or more GraphQL errors and no data was
///   available to return.
/// - ``missingData``: The response contained neither `data` nor GraphQL errors.
///
/// This error only describes invalid GraphQL response state. Transport-level failures, request
/// execution failures, and other networking errors are surfaced separately by the network transport
/// and request chain APIs.
public enum Error: Swift.Error, Sendable {
  /// The response included one or more GraphQL errors and did not contain usable data.
  case graphQLErrors([GraphQLError])

  /// The response contained neither data nor GraphQL errors.
  case missingData
}

Similar to Kotlins dataOrThrow or dataAssertNoErrors
@apollo-librarian

apollo-librarian Bot commented Jun 5, 2026

Copy link
Copy Markdown

✅ AI Style Review — No Changes Detected

No MDX files were changed in this pull request.

Review Log: View detailed log

This review is AI-generated. Please use common sense when accepting these suggestions, as they may not always be accurate or appropriate for your specific context.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

We do not accept PRs directly to the 'apollo-ios' repo. All development is done through the 'apollo-ios-dev' repo, please see the CONTRIBUTING guide for more information.

@github-actions github-actions Bot closed this Jun 5, 2026
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