errorskey. For example in GraphQL if you send an unauthenticated request to an API that requires authentication you'll get a response of this type:
errorsresponse is part of Graphql Specification and is described as a field containing a list of non-typed objects in the API contract (aka the Graphql schema). This implies that when you call a classic GraphQL API, the errors that occur are not guaranteed to be structured in a certain way - this is on purpose!
Rejectionconcept to our API.
Rejectionis a GraphQL type returned by mutations, and only mutations, from the Swan API when a request is rejected due to a business rule. Here is how a
Rejectionis described in our schema:
Rejectionwill have a type extending the
Rejectioninterface. For example, if you try to access a
Consentthat doesn't exist, you will receive a
Rejectionin return, described like this:
Consentwill be specified.
cancelConsentmutation is a simple illustration.
CancelConsentPayloadcontaining the cancelled
Consent, if the consent was not found it will return
Rejectionis more clear (if not, read the section just above), let's look at how to make requests to Swan API and handle different cases. Let's take the example of our
... On Rejection:
Rejectionfrom the API you can add as many
... On ARejectionNameas the number of