diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3f10b43193344..26c228a3bbdf3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,4 +22,6 @@ jobs: with: go-version: '^1.16.2' - name: vet - run: go vet ./... \ No newline at end of file + run: go vet ./... + - name: test + run: go test ./... \ No newline at end of file diff --git a/example/github/interfaces.md b/example/github/interfaces.md index ea1c97d30338c..8b4c7e39e67bf 100644 --- a/example/github/interfaces.md +++ b/example/github/interfaces.md @@ -1740,7 +1740,7 @@ either curated or that have been selected automatically based on popularity.
Identifies if the repository is private.
Identifies if the repository is private or internal.
Represents a type that can be required by a pull request for merging.
+ +#### Implemented by + + +- [CheckRun](objects.md#checkrun) +- [StatusContext](objects.md#statuscontext) + +#### Fields + +Name | +Description | +|||
---|---|---|---|---|
isRequired (Boolean!) | +
+ Whether this is required to pass before merging for a specific pull request. +
|
+
Entities that can be sponsored through GitHub Sponsors
diff --git a/example/github/objects.md b/example/github/objects.md index be801fa38abb2..fc6ac6a56d088 100644 --- a/example/github/objects.md +++ b/example/github/objects.md @@ -1915,6 +1915,7 @@ range’s change. - [Node](interfaces.md#node) +- [RequirableByPullRequest](interfaces.md#requirablebypullrequest) - [UniformResourceLocatable](interfaces.md#uniformresourcelocatable) #### Fields @@ -1990,15 +1991,21 @@ range’s change.Whether this check run is required to pass before merging.
+Whether this is required to pass before merging for a specific pull request.
Arguments |
---|
- pullRequestId (ID!) -The pull request this check is required for +pullRequestId (ID) +The id of the pull request this is required for + |
+
+ pullRequestNumber (Int) +The number of the pull request this is required for |
The pull requests associated with a commit
+The merged Pull Request that introduced the commit to the repository. If the +commit is not present in the default branch, additionally returns open Pull +Requests associated with the commit
Arguments | @@ -8903,7 +8912,7 @@ repository can change repository visibility.|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
isPrivate (Boolean!) | -Identifies if the repository is private. |
+ Identifies if the repository is private or internal. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
name (String!) | @@ -21169,6 +21178,14 @@ merged, or if the test merge commit is still being generated. See theviewerDidAuthor (Boolean!) | Did the viewer author this comment. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
viewerLatestReview (PullRequestReview) | +The latest review given from the viewer. |
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
viewerLatestReviewRequest (ReviewRequest) | +The person who has requested the viewer for review on this pull request. |
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
viewerMergeBodyText (String!) | @@ -26767,7 +26784,7 @@ organization or user being viewed owns. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isPrivate (Boolean!) | -Identifies if the repository is private. |
+ Identifies if the repository is private or internal. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isSecurityPolicyEnabled (Boolean) | @@ -29949,6 +29966,12 @@ amount goals. Represents a count of unique sponsors for total sponsors count goaadminInfo (SponsorsTierAdminInfo) | SponsorsTier information only visible to users that can administer the associated Sponsors listing. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
closestLesserValueTier (SponsorsTier) | +Get a different tier for this tier’s maintainer that is at the same frequency +as this tier but with a lesser cost. Returns the published tier with the +monthly price closest to this tier’s without going over. |
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdAt (DateTime!) | Identifies the date and time when the object was created. |
@@ -29965,6 +29988,15 @@ amount goals. Represents a count of unique sponsors for total sponsors count goa
id (ID!) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isCustomAmount (Boolean!) | +Whether this tier was chosen at checkout time by the sponsor rather than +defined ahead of time by the maintainer who manages the Sponsors listing. |
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isOneTime (Boolean!) | +Whether this tier is only for use with one-time sponsorships. |
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
monthlyPriceInCents (Int!) | How much this tier costs per month in cents. |
@@ -30130,6 +30162,10 @@ blank, the sponsorships will be ordered based on relevancy to the viewer.id (ID!)
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isOneTimePayment (Boolean!) | +Whether this sponsorship represents a one-time payment versus a recurring sponsorship. |
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
maintainer (User!) | The entity that is being sponsored |
@@ -30548,7 +30584,8 @@ blank, the sponsorships will be ordered based on relevancy to the viewer.
isRequired (Boolean!) |
- Whether this status is required to pass before merging. +Whether this is required to pass before merging for a specific pull request.
The set of valid sort keys for the Article query. + +
The set of valid sort keys for the Blog query. + +
Card brand, such as Visa or Mastercard, which can be used for payments. + +
Possible error codes that could be returned by CheckoutUserError. + +
The set of valid sort keys for the Collection query. + +
ISO 3166-1 alpha-2 country codes with some differences. + +
The part of the image that should remain after cropping. + +
Currency codes. + +
Possible error codes that could be returned by CustomerUserError. + +
Digital wallet, such as Apple Pay, which can be used for accelerated checkouts. + +
The method by which the discount’s value is allocated onto its entitled lines. + +
Which lines on the order that the discount is allocated over, of the type +defined by the Discount Application’s target_type. + +
The type of line (i.e. line item or shipping line) on an order that the discount is applicable towards. + +
List of supported image content types. + +
The possible content types for a media object. + +
Host for a Media Resource. + +
Metafield value types. + +
Represents the reason for the order’s cancellation. + +
Represents the order’s current financial status. + +
Represents the order’s current fulfillment status. + +
The set of valid sort keys for the Order query. + +
The set of valid sort keys for the Page query. + +
The valid values for the types of payment token. + +
The set of valid sort keys for the ProductCollection query. + +
The set of valid sort keys for the ProductImage query. + +
The set of valid sort keys for the ProductMedia query. + +
The set of valid sort keys for the Product query. + +
The set of valid sort keys for the ProductVariant query. + +
The different kinds of order transactions. + +
Transaction statuses describe the status of a transaction. + +
The accepted types of unit of measurement. + +
The valid units of measurement for a unit price measurement. + +
Units of measurement for weight. + +
Specifies the input fields required for an attribute. + + +#### Input fields + +
Specifies the fields required to update a checkout’s attributes. + + +#### Input fields + +
Specifies the fields required to update a checkout’s attributes. + + +#### Input fields + +
Specifies the fields required to create a checkout. + + +#### Input fields + +
Specifies the input fields to create a line item on a checkout. + + +#### Input fields + +
Specifies the input fields to update a line item on the checkout. + + +#### Input fields + +
Specifies the fields required to complete a checkout with +a Shopify vaulted credit card payment. + + +#### Input fields + +
Specifies the fields required to complete a checkout with +a Shopify vaulted credit card payment. + + +#### Input fields + +
Specifies the input fields required to create a customer access token. + + +#### Input fields + +
Specifies the input fields required to activate a customer. + + +#### Input fields + +
Specifies the fields required to create a new customer. + + +#### Input fields + +
Specifies the fields required to reset a customer’s password. + + +#### Input fields + +
Specifies the fields required to update the Customer information. + + +#### Input fields + +
Specifies the fields accepted to create or update a mailing address. + + +#### Input fields + +
Specifies the fields for a monetary value with currency. + + +#### Input fields + +
Specifies the input fields required for a selected option. + + +#### Input fields + +
Specifies the fields required to complete a checkout with +a tokenized payment. + + +#### Input fields + +
Specifies the fields required to complete a checkout with +a tokenized payment. + + +#### Input fields + +
Specifies the fields required to complete a checkout with +a tokenized payment. + + +#### Input fields + +
Discount applications capture the intentions of a discount source at +the time of application. + +#### Implemented by + + +- [AutomaticDiscountApplication](objects.md#automaticdiscountapplication) +- [DiscountCodeApplication](objects.md#discountcodeapplication) +- [ManualDiscountApplication](objects.md#manualdiscountapplication) +- [ScriptDiscountApplication](objects.md#scriptdiscountapplication) + +#### Fields + +
Represents an error in the input of a mutation. + +#### Implemented by + + +- [CheckoutUserError](objects.md#checkoutusererror) +- [CustomerUserError](objects.md#customerusererror) +- [UserError](objects.md#usererror) + +#### Fields + +
Represents information about the metafields associated to the specified resource. + +#### Implemented by + + +- [Product](objects.md#product) +- [ProductVariant](objects.md#productvariant) + +#### Fields + +
Represents a media interface. + +#### Implemented by + + +- [ExternalVideo](objects.md#externalvideo) +- [MediaImage](objects.md#mediaimage) +- [Model3d](objects.md#model3d) +- [Video](objects.md#video) + +#### Fields + +
An object with an ID to support global identification. + +#### Implemented by + + +- [AppliedGiftCard](objects.md#appliedgiftcard) +- [Article](objects.md#article) +- [Blog](objects.md#blog) +- [Checkout](objects.md#checkout) +- [CheckoutLineItem](objects.md#checkoutlineitem) +- [Collection](objects.md#collection) +- [Comment](objects.md#comment) +- [ExternalVideo](objects.md#externalvideo) +- [MailingAddress](objects.md#mailingaddress) +- [MediaImage](objects.md#mediaimage) +- [Metafield](objects.md#metafield) +- [Model3d](objects.md#model3d) +- [Order](objects.md#order) +- [Page](objects.md#page) +- [Payment](objects.md#payment) +- [Product](objects.md#product) +- [ProductOption](objects.md#productoption) +- [ProductVariant](objects.md#productvariant) +- [ShopPolicy](objects.md#shoppolicy) +- [Video](objects.md#video) + +#### Fields + +
Updates the attributes of a checkout. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + +- input ([CheckoutAttributesUpdateInput!](input_objects.md#checkoutattributesupdateinput)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout!](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutAttributesUpdateV2 + +Updates the attributes of a checkout. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + +- input ([CheckoutAttributesUpdateV2Input!](input_objects.md#checkoutattributesupdatev2input)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutCompleteFree + +Completes a checkout without providing payment information. You can use this +mutation for free items or items whose purchase price is covered by a gift card. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutCompleteWithCreditCard + +Completes a checkout using a credit card token from Shopify’s Vault. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + +- payment ([CreditCardPaymentInput!](input_objects.md#creditcardpaymentinput)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout!](objects.md#checkout)) |The checkout on which the payment was applied. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| payment ([Payment](objects.md#payment)) |A representation of the attempted payment. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutCompleteWithCreditCardV2 + +Completes a checkout using a credit card token from Shopify’s card vault. +Before you can complete checkouts using CheckoutCompleteWithCreditCardV2, you +need to request payment processing. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + +- payment ([CreditCardPaymentInputV2!](input_objects.md#creditcardpaymentinputv2)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The checkout on which the payment was applied. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| payment ([Payment](objects.md#payment)) |A representation of the attempted payment. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutCompleteWithTokenizedPayment + +Completes a checkout with a tokenized payment. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + +- payment ([TokenizedPaymentInput!](input_objects.md#tokenizedpaymentinput)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout!](objects.md#checkout)) |The checkout on which the payment was applied. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| payment ([Payment](objects.md#payment)) |A representation of the attempted payment. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutCompleteWithTokenizedPaymentV2 + +Completes a checkout with a tokenized payment. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + +- payment ([TokenizedPaymentInputV2!](input_objects.md#tokenizedpaymentinputv2)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The checkout on which the payment was applied. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| payment ([Payment](objects.md#payment)) |A representation of the attempted payment. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutCompleteWithTokenizedPaymentV3 + +Completes a checkout with a tokenized payment. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + +- payment ([TokenizedPaymentInputV3!](input_objects.md#tokenizedpaymentinputv3)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The checkout on which the payment was applied. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| payment ([Payment](objects.md#payment)) |A representation of the attempted payment. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutCreate + +Creates a new checkout. + +#### Input fields + +- input ([CheckoutCreateInput!](input_objects.md#checkoutcreateinput)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The new checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutCustomerAssociate + +Associates a customer to the checkout. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + +- customerAccessToken ([String!](scalars.md#string)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout!](objects.md#checkout)) |The updated checkout object. | +| customer ([Customer](objects.md#customer)) |The associated customer object. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutCustomerAssociateV2 + +Associates a customer to the checkout. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + +- customerAccessToken ([String!](scalars.md#string)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| customer ([Customer](objects.md#customer)) |The associated customer object. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutCustomerDisassociate + +Disassociates the current checkout customer from the checkout. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout!](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutCustomerDisassociateV2 + +Disassociates the current checkout customer from the checkout. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutDiscountCodeApply + +Applies a discount to an existing checkout using a discount code. + +#### Input fields + +- discountCode ([String!](scalars.md#string)) + +- checkoutId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout!](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutDiscountCodeApplyV2 + +Applies a discount to an existing checkout using a discount code. + +#### Input fields + +- discountCode ([String!](scalars.md#string)) + +- checkoutId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutDiscountCodeRemove + +Removes the applied discount from an existing checkout. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutEmailUpdate + +Updates the email on an existing checkout. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + +- email ([String!](scalars.md#string)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout!](objects.md#checkout)) |The checkout object with the updated email. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutEmailUpdateV2 + +Updates the email on an existing checkout. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + +- email ([String!](scalars.md#string)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The checkout object with the updated email. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutGiftCardApply + +Applies a gift card to an existing checkout using a gift card code. This will replace all currently applied gift cards. + +#### Input fields + +- giftCardCode ([String!](scalars.md#string)) + +- checkoutId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout!](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutGiftCardRemove + +Removes an applied gift card from the checkout. + +#### Input fields + +- appliedGiftCardId ([ID!](scalars.md#id)) + +- checkoutId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout!](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutGiftCardRemoveV2 + +Removes an applied gift card from the checkout. + +#### Input fields + +- appliedGiftCardId ([ID!](scalars.md#id)) + +- checkoutId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutGiftCardsAppend + +Appends gift cards to an existing checkout. + +#### Input fields + +- giftCardCodes ([[String!]!](scalars.md#string)) + +- checkoutId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutLineItemsAdd + +Adds a list of line items to a checkout. + +#### Input fields + +- lineItems ([[CheckoutLineItemInput!]!](input_objects.md#checkoutlineiteminput)) + +- checkoutId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutLineItemsRemove + +Removes line items from an existing checkout. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + +- lineItemIds ([[ID!]!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutLineItemsReplace + +Sets a list of line items to a checkout. + +#### Input fields + +- lineItems ([[CheckoutLineItemInput!]!](input_objects.md#checkoutlineiteminput)) + +- checkoutId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The updated checkout object. | +| userErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutLineItemsUpdate + +Updates line items on a checkout. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + +- lineItems ([[CheckoutLineItemUpdateInput!]!](input_objects.md#checkoutlineitemupdateinput)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutShippingAddressUpdate + +Updates the shipping address of an existing checkout. + +#### Input fields + +- shippingAddress ([MailingAddressInput!](input_objects.md#mailingaddressinput)) + +- checkoutId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout!](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutShippingAddressUpdateV2 + +Updates the shipping address of an existing checkout. + +#### Input fields + +- shippingAddress ([MailingAddressInput!](input_objects.md#mailingaddressinput)) + +- checkoutId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### checkoutShippingLineUpdate + +Updates the shipping lines on an existing checkout. + +#### Input fields + +- checkoutId ([ID!](scalars.md#id)) + +- shippingRateHandle ([String!](scalars.md#string)) + + +#### Returns + +| Name | Description | +|------|-------------| +| checkout ([Checkout](objects.md#checkout)) |The updated checkout object. | +| checkoutUserErrors ([[CheckoutUserError!]!](objects.md#checkoutusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerAccessTokenCreate + +Creates a customer access token. +The customer access token is required to modify the customer object in any way. + +#### Input fields + +- input ([CustomerAccessTokenCreateInput!](input_objects.md#customeraccesstokencreateinput)) + + +#### Returns + +| Name | Description | +|------|-------------| +| customerAccessToken ([CustomerAccessToken](objects.md#customeraccesstoken)) |The newly created customer access token object. | +| customerUserErrors ([[CustomerUserError!]!](objects.md#customerusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerAccessTokenCreateWithMultipass + +Creates a customer access token using a multipass token instead of email and password. +A customer record is created if customer does not exist. If a customer record already +exists but the record is disabled, then it’s enabled. + +#### Input fields + +- multipassToken ([String!](scalars.md#string)) + + +#### Returns + +| Name | Description | +|------|-------------| +| customerAccessToken ([CustomerAccessToken](objects.md#customeraccesstoken)) |An access token object associated with the customer. | +| customerUserErrors ([[CustomerUserError!]!](objects.md#customerusererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerAccessTokenDelete + +Permanently destroys a customer access token. + +#### Input fields + +- customerAccessToken ([String!](scalars.md#string)) + + +#### Returns + +| Name | Description | +|------|-------------| +| deletedAccessToken ([String](scalars.md#string)) |The destroyed access token. | +| deletedCustomerAccessTokenId ([String](scalars.md#string)) |ID of the destroyed customer access token. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerAccessTokenRenew + +Renews a customer access token. + +Access token renewal must happen before a token expires.
+If a token has already expired, a new one should be created instead via The renewed customer access token object. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerActivate + +Activates a customer. + +#### Input fields + +- id ([ID!](scalars.md#id)) + +- input ([CustomerActivateInput!](input_objects.md#customeractivateinput)) + + +#### Returns + +| Name | Description | +|------|-------------| +| customer ([Customer](objects.md#customer)) |The customer object. | +| customerAccessToken ([CustomerAccessToken](objects.md#customeraccesstoken)) |A newly created customer access token object for the customer. | +| customerUserErrors ([[CustomerUserError!]!](objects.md#customerusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerActivateByUrl + +Activates a customer with the activation url received from The customer that was activated. | +| customerAccessToken ([CustomerAccessToken](objects.md#customeraccesstoken)) |A new customer access token for the customer. | +| customerUserErrors ([[CustomerUserError!]!](objects.md#customerusererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerAddressCreate + +Creates a new address for a customer. + +#### Input fields + +- customerAccessToken ([String!](scalars.md#string)) + +- address ([MailingAddressInput!](input_objects.md#mailingaddressinput)) + + +#### Returns + +| Name | Description | +|------|-------------| +| customerAddress ([MailingAddress](objects.md#mailingaddress)) |The new customer address object. | +| customerUserErrors ([[CustomerUserError!]!](objects.md#customerusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerAddressDelete + +Permanently deletes the address of an existing customer. + +#### Input fields + +- id ([ID!](scalars.md#id)) + +- customerAccessToken ([String!](scalars.md#string)) + + +#### Returns + +| Name | Description | +|------|-------------| +| customerUserErrors ([[CustomerUserError!]!](objects.md#customerusererror)) |List of errors that occurred executing the mutation. | +| deletedCustomerAddressId ([String](scalars.md#string)) |ID of the deleted customer address. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerAddressUpdate + +Updates the address of an existing customer. + +#### Input fields + +- customerAccessToken ([String!](scalars.md#string)) + +- id ([ID!](scalars.md#id)) + +- address ([MailingAddressInput!](input_objects.md#mailingaddressinput)) + + +#### Returns + +| Name | Description | +|------|-------------| +| customerAddress ([MailingAddress](objects.md#mailingaddress)) |The customer’s updated mailing address. | +| customerUserErrors ([[CustomerUserError!]!](objects.md#customerusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerCreate + +Creates a new customer. + +#### Input fields + +- input ([CustomerCreateInput!](input_objects.md#customercreateinput)) + + +#### Returns + +| Name | Description | +|------|-------------| +| customer ([Customer](objects.md#customer)) |The created customer object. | +| customerUserErrors ([[CustomerUserError!]!](objects.md#customerusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerDefaultAddressUpdate + +Updates the default address of an existing customer. + +#### Input fields + +- customerAccessToken ([String!](scalars.md#string)) + +- addressId ([ID!](scalars.md#id)) + + +#### Returns + +| Name | Description | +|------|-------------| +| customer ([Customer](objects.md#customer)) |The updated customer object. | +| customerUserErrors ([[CustomerUserError!]!](objects.md#customerusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerRecover + +Sends a reset password email to the customer, as the first step in the reset password process. + +#### Input fields + +- email ([String!](scalars.md#string)) + + +#### Returns + +| Name | Description | +|------|-------------| +| customerUserErrors ([[CustomerUserError!]!](objects.md#customerusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerReset + +Resets a customer’s password with a token received from The customer object which was reset. | +| customerAccessToken ([CustomerAccessToken](objects.md#customeraccesstoken)) |A newly created customer access token object for the customer. | +| customerUserErrors ([[CustomerUserError!]!](objects.md#customerusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerResetByUrl + +Resets a customer’s password with the reset password url received from The customer object which was reset. | +| customerAccessToken ([CustomerAccessToken](objects.md#customeraccesstoken)) |A newly created customer access token object for the customer. | +| customerUserErrors ([[CustomerUserError!]!](objects.md#customerusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- + +### customerUpdate + +Updates an existing customer. + +#### Input fields + +- customerAccessToken ([String!](scalars.md#string)) + +- customer ([CustomerUpdateInput!](input_objects.md#customerupdateinput)) + + +#### Returns + +| Name | Description | +|------|-------------| +| customer ([Customer](objects.md#customer)) |The updated customer object. | +| customerAccessToken ([CustomerAccessToken](objects.md#customeraccesstoken)) |The newly created customer access token. If the customer’s password is updated, all previous access tokens +(including the one used to perform this mutation) become invalid, and a new token is generated. | +| customerUserErrors ([[CustomerUserError!]!](objects.md#customerusererror)) |List of errors that occurred executing the mutation. | +| userErrors ([[UserError!]!](objects.md#usererror)) |List of errors that occurred executing the mutation. | + +--- \ No newline at end of file diff --git a/example/shopify/objects.md b/example/shopify/objects.md new file mode 100644 index 0000000000000..1b4271b1e8e33 --- /dev/null +++ b/example/shopify/objects.md @@ -0,0 +1,6752 @@ +# Objects + +### About objects + +[Objects](https://graphql.github.io/graphql-spec/June2018/#sec-Objects) in GraphQL represent the resources you can access. An object can contain a list of fields, which are specifically typed. + +### ApiVersion + +A version of the API. + +#### Fields + +
Details about the gift card used on the checkout. + +#### Implements + + +- [Node](interfaces.md#node) + +#### Fields + +
An article in an online store blog. + +#### Implements + + +- [Node](interfaces.md#node) + +#### Fields + +
The author of an article. + +#### Fields + +
An auto-generated type for paginating through multiple Articles. + +#### Fields + +
An auto-generated type which holds one Article and a cursor during pagination. + +#### Fields + +
Represents a generic custom attribute. + +#### Fields + +
Automatic discount applications capture the intentions of a discount that was automatically applied. + +#### Implements + + +- [DiscountApplication](interfaces.md#discountapplication) + +#### Fields + +
A collection of available shipping rates for a checkout. + +#### Fields + +
An online store blog. + +#### Implements + + +- [Node](interfaces.md#node) + +#### Fields + +
An auto-generated type for paginating through multiple Blogs. + +#### Fields + +
An auto-generated type which holds one Blog and a cursor during pagination. + +#### Fields + +
A container for all the information required to checkout items and pay. + +#### Implements + + +- [Node](interfaces.md#node) + +#### Fields + +
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
A single line item in the checkout, grouped by variant and attributes. + +#### Implements + + +- [Node](interfaces.md#node) + +#### Fields + +
An auto-generated type for paginating through multiple CheckoutLineItems. + +#### Fields + +
An auto-generated type which holds one CheckoutLineItem and a cursor during pagination. + +#### Fields + +
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Represents an error that happens during execution of a checkout mutation. + +#### Implements + + +- [DisplayableError](interfaces.md#displayableerror) + +#### Fields + +
A collection represents a grouping of products that a shop owner can create to +organize them or make their shops easier to browse. + +#### Implements + + +- [Node](interfaces.md#node) + +#### Fields + +
An auto-generated type for paginating through multiple Collections. + +#### Fields + +
An auto-generated type which holds one Collection and a cursor during pagination. + +#### Fields + +
A comment on an article. + +#### Implements + + +- [Node](interfaces.md#node) + +#### Fields + +
The author of a comment. + +#### Fields + +
An auto-generated type for paginating through multiple Comments. + +#### Fields + +
An auto-generated type which holds one Comment and a cursor during pagination. + +#### Fields + +
Credit card information used for a payment. + +#### Fields + +
A customer represents a customer account with the shop. Customer accounts store +contact information for the customer, saving logged-in customers the trouble of +having to provide it at every checkout. + +#### Fields + +
A CustomerAccessToken represents the unique token required to make modifications to the customer object. + +#### Fields + +
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Return type for
Represents an error that happens during execution of a customer mutation. + +#### Implements + + +- [DisplayableError](interfaces.md#displayableerror) + +#### Fields + +
An amount discounting the line that has been allocated by a discount. + +#### Fields + +
An auto-generated type for paginating through multiple DiscountApplications. + +#### Fields + +
An auto-generated type which holds one DiscountApplication and a cursor during pagination. + +#### Fields + +
Discount code applications capture the intentions of a discount code at +the time that it is applied. + +#### Implements + + +- [DiscountApplication](interfaces.md#discountapplication) + +#### Fields + +
Represents a web address. + +#### Fields + +
Represents a video hosted outside of Shopify. + +#### Implements + + +- [Media](interfaces.md#media) +- [Node](interfaces.md#node) + +#### Fields + +
Represents a single fulfillment in an order. + +#### Fields + +
Represents a single line item in a fulfillment. There is at most one fulfillment line item for each order line item. + +#### Fields + +
An auto-generated type for paginating through multiple FulfillmentLineItems. + +#### Fields + +
An auto-generated type which holds one FulfillmentLineItem and a cursor during pagination. + +#### Fields + +
Tracking information associated with the fulfillment. + +#### Fields + +
Represents an image resource. + +#### Fields + +
An auto-generated type for paginating through multiple Images. + +#### Fields + +
An auto-generated type which holds one Image and a cursor during pagination. + +#### Fields + +
Represents a mailing address for customers and shipping. + +#### Implements + + +- [Node](interfaces.md#node) + +#### Fields + +
An auto-generated type for paginating through multiple MailingAddresses. + +#### Fields + +
An auto-generated type which holds one MailingAddress and a cursor during pagination. + +#### Fields + +
Manual discount applications capture the intentions of a discount that was manually created. + +#### Implements + + +- [DiscountApplication](interfaces.md#discountapplication) + +#### Fields + +
An auto-generated type for paginating through multiple Media. + +#### Fields + +
An auto-generated type which holds one Media and a cursor during pagination. + +#### Fields + +
Represents a Shopify hosted image. + +#### Implements + + +- [Media](interfaces.md#media) +- [Node](interfaces.md#node) + +#### Fields + +
Metafields represent custom metadata attached to a resource. Metafields can be sorted into namespaces and are +comprised of keys, values, and value types. + +#### Implements + + +- [Node](interfaces.md#node) + +#### Fields + +
An auto-generated type for paginating through multiple Metafields. + +#### Fields + +
An auto-generated type which holds one Metafield and a cursor during pagination. + +#### Fields + +
Represents a Shopify hosted 3D model. + +#### Implements + + +- [Media](interfaces.md#media) +- [Node](interfaces.md#node) + +#### Fields + +
Represents a source for a Shopify hosted 3d model. + +#### Fields + +
A monetary value with currency. + +To format currencies, combine this type’s amount and currencyCode fields with your client’s locale. + +For example, in JavaScript you could use Intl.NumberFormat: + +
+
+Other formatting libraries include: + +
For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations +(such as TwitterCldr). + +#### Fields + +
An auto-generated type for paginating through multiple MoneyV2s. + +#### Fields + +
An auto-generated type which holds one MoneyV2 and a cursor during pagination. + +#### Fields + +
An order is a customer’s completed request to purchase one or more products from +a shop. An order is created when a customer completes the checkout process, +during which time they provides an email address, billing address and payment information. + +#### Implements + + +- [Node](interfaces.md#node) + +#### Fields + +
An auto-generated type for paginating through multiple Orders. + +#### Fields + +
An auto-generated type which holds one Order and a cursor during pagination. + +#### Fields + +
Represents a single line in an order. There is one line item for each distinct product variant. + +#### Fields + +
An auto-generated type for paginating through multiple OrderLineItems. + +#### Fields + +
An auto-generated type which holds one OrderLineItem and a cursor during pagination. + +#### Fields + +
Shopify merchants can create pages to hold static HTML content. Each Page object +represents a custom page on the online store. + +#### Implements + + +- [Node](interfaces.md#node) + +#### Fields + +
An auto-generated type for paginating through multiple Pages. + +#### Fields + +
An auto-generated type which holds one Page and a cursor during pagination. + +#### Fields + +
Information about pagination in a connection. + +#### Fields + +
A payment applied to a checkout. + +#### Implements + + +- [Node](interfaces.md#node) + +#### Fields + +
Settings related to payments. + +#### Fields + +
The value of the percentage pricing object. + +#### Fields + +
A product represents an individual item for sale in a Shopify store. Products are often physical, but they don’t have to be. +For example, a digital download (such as a movie, music or ebook file) also +qualifies as a product, as do services (such as equipment rental, work for hire, +customization of another product or an extended warranty). + +#### Implements + + +- [HasMetafields](interfaces.md#hasmetafields) +- [Node](interfaces.md#node) + +#### Fields + +
An auto-generated type for paginating through multiple Products. + +#### Fields + +
An auto-generated type which holds one Product and a cursor during pagination. + +#### Fields + +
Product property names like “Size”, “Color”, and “Material” that the customers can select. +Variants are selected based on permutations of these options. +255 characters limit each. + +#### Implements + + +- [Node](interfaces.md#node) + +#### Fields + +
The price range of the product. + +#### Fields + +
An auto-generated type for paginating through multiple ProductPriceRanges. + +#### Fields + +
An auto-generated type which holds one ProductPriceRange and a cursor during pagination. + +#### Fields + +
A product variant represents a different version of a product, such as differing sizes or differing colors. + +#### Implements + + +- [HasMetafields](interfaces.md#hasmetafields) +- [Node](interfaces.md#node) + +#### Fields + +
An auto-generated type for paginating through multiple ProductVariants. + +#### Fields + +
An auto-generated type which holds one ProductVariant and a cursor during pagination. + +#### Fields + +
The compare-at price and price of a variant sharing a currency. + +#### Fields + +
An auto-generated type for paginating through multiple ProductVariantPricePairs. + +#### Fields + +
An auto-generated type which holds one ProductVariantPricePair and a cursor during pagination. + +#### Fields + +
The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. + +#### Fields + +
SEO information. + +#### Fields + +
Script discount applications capture the intentions of a discount that +was created by a Shopify Script. + +#### Implements + + +- [DiscountApplication](interfaces.md#discountapplication) + +#### Fields + +
Properties used by customers to select a product variant. +Products can have multiple options, like different sizes or colors. + +#### Fields + +
A shipping rate to be applied to a checkout. + +#### Fields + +
Shop represents a collection of the general settings and information about the shop. + +#### Fields + +
Policy that a merchant has configured for their store, such as their refund or privacy policy. + +#### Implements + + +- [Node](interfaces.md#node) + +#### Fields + +
An auto-generated type for paginating through multiple Strings. + +#### Fields + +
An auto-generated type which holds one String and a cursor during pagination. + +#### Fields + +
An object representing exchange of money for a product or service. + +#### Fields + +
The measurement used to calculate a unit price for a product variant (e.g. $9.99 / 100ml). + +#### Fields + +
Represents an error in the input of a mutation. + +#### Implements + + +- [DisplayableError](interfaces.md#displayableerror) + +#### Fields + +
Represents a Shopify hosted video. + +#### Implements + + +- [Media](interfaces.md#media) +- [Node](interfaces.md#node) + +#### Fields + +
Represents a source for a Shopify hosted video. + +#### Fields + +
Returns up to the first Returns the elements that come after the specified cursor. | +| last ([Int](scalars.md#int)) |Returns up to the last Returns the elements that come before the specified cursor. | +| reverse ([Boolean](scalars.md#boolean)) |Reverse the order of the underlying list. | +| sortKey ([ArticleSortKeys](enums.md#articlesortkeys)) |Sort the underlying list by the given key. | +| query ([String](scalars.md#string)) |Supported filter parameters:
+ - See the detailed search syntax +for more information about using filters. | + +--- + +### blogByHandle + +#### Type: [Blog](objects.md#blog) + +Find a blog by its handle. + +#### Arguments + +| Name | Description | +|------|-------------| +| handle ([String!](scalars.md#string)) |The handle of the blog. | + +--- + +### blogs + +#### Type: [BlogConnection!](objects.md#blogconnection) + +List of the shop's blogs. + +#### Arguments + +| Name | Description | +|------|-------------| +| first ([Int](scalars.md#int)) |Returns up to the first Returns the elements that come after the specified cursor. | +| last ([Int](scalars.md#int)) |Returns up to the last Returns the elements that come before the specified cursor. | +| reverse ([Boolean](scalars.md#boolean)) |Reverse the order of the underlying list. | +| sortKey ([BlogSortKeys](enums.md#blogsortkeys)) |Sort the underlying list by the given key. | +| query ([String](scalars.md#string)) |Supported filter parameters:
+ - See the detailed search syntax +for more information about using filters. | + +--- + +### collectionByHandle + +#### Type: [Collection](objects.md#collection) + +Find a collection by its handle. + +#### Arguments + +| Name | Description | +|------|-------------| +| handle ([String!](scalars.md#string)) |The handle of the collection. | + +--- + +### collections + +#### Type: [CollectionConnection!](objects.md#collectionconnection) + +List of the shop’s collections. + +#### Arguments + +| Name | Description | +|------|-------------| +| first ([Int](scalars.md#int)) |Returns up to the first Returns the elements that come after the specified cursor. | +| last ([Int](scalars.md#int)) |Returns up to the last Returns the elements that come before the specified cursor. | +| reverse ([Boolean](scalars.md#boolean)) |Reverse the order of the underlying list. | +| sortKey ([CollectionSortKeys](enums.md#collectionsortkeys)) |Sort the underlying list by the given key. | +| query ([String](scalars.md#string)) |Supported filter parameters:
+ - See the detailed search syntax +for more information about using filters. | + +--- + +### customer + +#### Type: [Customer](objects.md#customer) + +Find a customer by its access token. + +#### Arguments + +| Name | Description | +|------|-------------| +| customerAccessToken ([String!](scalars.md#string)) |The customer access token. | + +--- + +### node + +#### Type: [Node](interfaces.md#node) + +Returns a specific node by ID. + +#### Arguments + +| Name | Description | +|------|-------------| +| id ([ID!](scalars.md#id)) |The ID of the Node to return. | + +--- + +### nodes + +#### Type: [[Node]!](interfaces.md#node) + +Returns the list of nodes with the given IDs. + +#### Arguments + +| Name | Description | +|------|-------------| +| ids ([[ID!]!](scalars.md#id)) |The IDs of the Nodes to return. | + +--- + +### pageByHandle + +#### Type: [Page](objects.md#page) + +Find a page by its handle. + +#### Arguments + +| Name | Description | +|------|-------------| +| handle ([String!](scalars.md#string)) |The handle of the page. | + +--- + +### pages + +#### Type: [PageConnection!](objects.md#pageconnection) + +List of the shop's pages. + +#### Arguments + +| Name | Description | +|------|-------------| +| first ([Int](scalars.md#int)) |Returns up to the first Returns the elements that come after the specified cursor. | +| last ([Int](scalars.md#int)) |Returns up to the last Returns the elements that come before the specified cursor. | +| reverse ([Boolean](scalars.md#boolean)) |Reverse the order of the underlying list. | +| sortKey ([PageSortKeys](enums.md#pagesortkeys)) |Sort the underlying list by the given key. | +| query ([String](scalars.md#string)) |Supported filter parameters:
+ - See the detailed search syntax +for more information about using filters. | + +--- + +### productByHandle + +#### Type: [Product](objects.md#product) + +Find a product by its handle. + +#### Arguments + +| Name | Description | +|------|-------------| +| handle ([String!](scalars.md#string)) |The handle of the product. | + +--- + +### productRecommendations + +#### Type: [[Product!]](objects.md#product) + +Find recommended products related to a given `product_id`. +To learn more about how recommendations are generated, see +[*Showing product recommendations on product pages*](https://help.shopify.com/themes/development/recommended-products). + +#### Arguments + +| Name | Description | +|------|-------------| +| productId ([ID!](scalars.md#id)) |The id of the product. | + +--- + +### productTags + +#### Type: [StringConnection!](objects.md#stringconnection) + +Tags added to products. +Additional access scope required: unauthenticated_read_product_tags. + +#### Arguments + +| Name | Description | +|------|-------------| +| first ([Int!](scalars.md#int)) |Returns up to the first Returns up to the first Returns up to the first Returns the elements that come after the specified cursor. | +| last ([Int](scalars.md#int)) |Returns up to the last Returns the elements that come before the specified cursor. | +| reverse ([Boolean](scalars.md#boolean)) |Reverse the order of the underlying list. | +| sortKey ([ProductSortKeys](enums.md#productsortkeys)) |Sort the underlying list by the given key. | +| query ([String](scalars.md#string)) |Supported filter parameters:
+ - See the detailed search syntax +for more information about using filters. | + +--- + +### publicApiVersions + +#### Type: [[ApiVersion!]!](objects.md#apiversion) + +The list of public Storefront API versions, including supported, release candidate and unstable versions. + +--- + +### shop + +#### Type: [Shop!](objects.md#shop) + +The shop associated with the storefront access token. + +--- \ No newline at end of file diff --git a/example/shopify/scalars.md b/example/shopify/scalars.md new file mode 100644 index 0000000000000..362e543c4daa2 --- /dev/null +++ b/example/shopify/scalars.md @@ -0,0 +1,69 @@ +# Scalars + +### About scalars + +[Scalars](https://graphql.github.io/graphql-spec/June2018/#sec-Scalars) are primitive values: `Int`, `Float`, `String`, `Boolean`, or `ID`. + +When calling the GraphQL API, you must specify nested subfields until you return only scalars. + +### Boolean + +The An ISO-8601 encoded UTC date time string. Example value: A signed decimal number, which supports arbitrary precision and is serialized as a string. Example value: The A string containing HTML code. Example value: The The A monetary value string. Example value: The An RFC 3986 and RFC 3987 compliant URI string. + +Example value: Grey cotton knit sweater. "`. +""" +scalar HTML + +"""Represents an image resource.""" +type Image { + """A word or phrase to share the nature or contents of an image.""" + altText: String + + """ + The original height of the image in pixels. Returns `null` if the image is not hosted by Shopify. + """ + height: Int + + """A unique identifier for the image.""" + id: ID + + """ + The location of the original image as a URL. + + If there are any existing transformations in the original source URL, they will remain and not be stripped. + + """ + originalSrc: URL! + + """The location of the image as a URL.""" + src: URL! @deprecated(reason: "Previously an image had a single `src` field. This could either return the original image\nlocation or a URL that contained transformations such as sizing or scale.\n\nThese transformations were specified by arguments on the parent field.\n\nNow an image has two distinct URL fields: `originalSrc` and `transformedSrc`.\n\n* `originalSrc` - the original unmodified image URL\n* `transformedSrc` - the image URL with the specified transformations included\n\nTo migrate to the new fields, image transformations should be moved from the parent field to `transformedSrc`.\n\nBefore:\n```graphql\n{\n shop {\n productImages(maxWidth: 200, scale: 2) {\n edges {\n node {\n src\n }\n }\n }\n }\n}\n```\n\nAfter:\n```graphql\n{\n shop {\n productImages {\n edges {\n node {\n transformedSrc(maxWidth: 200, scale: 2)\n }\n }\n }\n }\n}\n```\n") + + """ + The location of the transformed image as a URL. + + All transformation arguments are considered "best-effort". If they can be applied to an image, they will be. + Otherwise any transformations which an image type does not support will be ignored. + + """ + transformedSrc( + """Image width in pixels between 1 and 5760.""" + maxWidth: Int + + """Image height in pixels between 1 and 5760.""" + maxHeight: Int + + """Crops the image according to the specified region.""" + crop: CropRegion + + """ + Image size multiplier for high-resolution retina displays. Must be between 1 and 3. + """ + scale: Int = 1 + + """ + Best effort conversion of image into content type (SVG -> PNG, Anything -> JGP, Anything -> WEBP are supported). + """ + preferredContentType: ImageContentType + ): URL! + + """ + The original width of the image in pixels. Returns `null` if the image is not hosted by Shopify. + """ + width: Int +} + +""" +An auto-generated type for paginating through multiple Images. + +""" +type ImageConnection { + """A list of edges.""" + edges: [ImageEdge!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! +} + +"""List of supported image content types.""" +enum ImageContentType { + """A PNG image.""" + PNG + + """A JPG image.""" + JPG + + """A WEBP image.""" + WEBP +} + +""" +An auto-generated type which holds one Image and a cursor during pagination. + +""" +type ImageEdge { + """A cursor for use in pagination.""" + cursor: String! + + """The item at the end of ImageEdge.""" + node: Image! +} + +"""Represents a mailing address for customers and shipping.""" +type MailingAddress implements Node { + """ + The first line of the address. Typically the street address or PO Box number. + + """ + address1: String + + """ + The second line of the address. Typically the number of the apartment, suite, or unit. + + """ + address2: String + + """ + The name of the city, district, village, or town. + + """ + city: String + + """ + The name of the customer's company or organization. + + """ + company: String + + """ + The name of the country. + + """ + country: String + + """ + The two-letter code for the country of the address. + + For example, US. + + """ + countryCode: String @deprecated(reason: "Use `countryCodeV2` instead") + + """ + The two-letter code for the country of the address. + + For example, US. + + """ + countryCodeV2: CountryCode + + """The first name of the customer.""" + firstName: String + + """ + A formatted version of the address, customized by the provided arguments. + """ + formatted( + """Whether to include the customer's name in the formatted address.""" + withName: Boolean = false + + """Whether to include the customer's company in the formatted address.""" + withCompany: Boolean = true + ): [String!]! + + """A comma-separated list of the values for city, province, and country.""" + formattedArea: String + + """Globally unique identifier.""" + id: ID! + + """The last name of the customer.""" + lastName: String + + """The latitude coordinate of the customer address.""" + latitude: Float + + """The longitude coordinate of the customer address.""" + longitude: Float + + """ + The full name of the customer, based on firstName and lastName. + + """ + name: String + + """ + A unique phone number for the customer. + + Formatted using E.164 standard. For example, _+16135551111_. + + """ + phone: String + + """The region of the address, such as the province, state, or district.""" + province: String + + """ + The two-letter code for the region. + + For example, ON. + + """ + provinceCode: String + + """The zip or postal code of the address.""" + zip: String +} + +""" +An auto-generated type for paginating through multiple MailingAddresses. + +""" +type MailingAddressConnection { + """A list of edges.""" + edges: [MailingAddressEdge!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one MailingAddress and a cursor during pagination. + +""" +type MailingAddressEdge { + """A cursor for use in pagination.""" + cursor: String! + + """The item at the end of MailingAddressEdge.""" + node: MailingAddress! +} + +"""Specifies the fields accepted to create or update a mailing address.""" +input MailingAddressInput { + """ + The first line of the address. Typically the street address or PO Box number. + + """ + address1: String + + """ + The second line of the address. Typically the number of the apartment, suite, or unit. + + """ + address2: String + + """ + The name of the city, district, village, or town. + + """ + city: String + + """ + The name of the customer's company or organization. + + """ + company: String + + """The name of the country.""" + country: String + + """The first name of the customer.""" + firstName: String + + """The last name of the customer.""" + lastName: String + + """ + A unique phone number for the customer. + + Formatted using E.164 standard. For example, _+16135551111_. + + """ + phone: String + + """The region of the address, such as the province, state, or district.""" + province: String + + """The zip or postal code of the address.""" + zip: String +} + +""" +Manual discount applications capture the intentions of a discount that was manually created. + +""" +type ManualDiscountApplication implements DiscountApplication { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """The description of the application.""" + description: String + + """Which lines of targetType that the discount is allocated over.""" + targetSelection: DiscountApplicationTargetSelection! + + """The type of line that the discount is applicable towards.""" + targetType: DiscountApplicationTargetType! + + """The title of the application.""" + title: String! + + """The value of the discount application.""" + value: PricingValue! +} + +"""Represents a media interface.""" +interface Media { + """A word or phrase to share the nature or contents of a media.""" + alt: String + + """The media content type.""" + mediaContentType: MediaContentType! + + """The preview image for the media.""" + previewImage: Image +} + +""" +An auto-generated type for paginating through multiple Media. + +""" +type MediaConnection { + """A list of edges.""" + edges: [MediaEdge!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! +} + +"""The possible content types for a media object.""" +enum MediaContentType { + """An externally hosted video.""" + EXTERNAL_VIDEO + + """A Shopify hosted image.""" + IMAGE + + """A 3d model.""" + MODEL_3D + + """A Shopify hosted video.""" + VIDEO +} + +""" +An auto-generated type which holds one Media and a cursor during pagination. + +""" +type MediaEdge { + """A cursor for use in pagination.""" + cursor: String! + + """The item at the end of MediaEdge.""" + node: Media! +} + +"""Host for a Media Resource.""" +enum MediaHost { + """Host for YouTube embedded videos.""" + YOUTUBE + + """Host for Vimeo embedded videos.""" + VIMEO +} + +"""Represents a Shopify hosted image.""" +type MediaImage implements Node & Media { + """A word or phrase to share the nature or contents of a media.""" + alt: String + + """Globally unique identifier.""" + id: ID! + + """The image for the media.""" + image: Image + + """The media content type.""" + mediaContentType: MediaContentType! + + """The preview image for the media.""" + previewImage: Image +} + +""" +Metafields represent custom metadata attached to a resource. Metafields can be sorted into namespaces and are +comprised of keys, values, and value types. + +""" +type Metafield implements Node { + """The date and time when the storefront metafield was created.""" + createdAt: DateTime! + + """The description of a metafield.""" + description: String + + """Globally unique identifier.""" + id: ID! + + """The key name for a metafield.""" + key: String! + + """The namespace for a metafield.""" + namespace: String! + + """The parent object that the metafield belongs to.""" + parentResource: MetafieldParentResource! + + """The date and time when the storefront metafield was updated.""" + updatedAt: DateTime! + + """The value of a metafield.""" + value: String! + + """Represents the metafield value type.""" + valueType: MetafieldValueType! +} + +""" +An auto-generated type for paginating through multiple Metafields. + +""" +type MetafieldConnection { + """A list of edges.""" + edges: [MetafieldEdge!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Metafield and a cursor during pagination. + +""" +type MetafieldEdge { + """A cursor for use in pagination.""" + cursor: String! + + """The item at the end of MetafieldEdge.""" + node: Metafield! +} + +"""A resource that the metafield belongs to.""" +union MetafieldParentResource = Product | ProductVariant + +"""Metafield value types.""" +enum MetafieldValueType { + """A string metafield.""" + STRING + + """An integer metafield.""" + INTEGER + + """A json string metafield.""" + JSON_STRING +} + +"""Represents a Shopify hosted 3D model.""" +type Model3d implements Node & Media { + """A word or phrase to share the nature or contents of a media.""" + alt: String + + """Globally unique identifier.""" + id: ID! + + """The media content type.""" + mediaContentType: MediaContentType! + + """The preview image for the media.""" + previewImage: Image + + """The sources for a 3d model.""" + sources: [Model3dSource!]! +} + +"""Represents a source for a Shopify hosted 3d model.""" +type Model3dSource { + """The filesize of the 3d model.""" + filesize: Int! + + """The format of the 3d model.""" + format: String! + + """The MIME type of the 3d model.""" + mimeType: String! + + """The URL of the 3d model.""" + url: String! +} + +"""A monetary value string. Example value: `"100.57"`.""" +scalar Money + +"""Specifies the fields for a monetary value with currency.""" +input MoneyInput { + """Decimal money amount.""" + amount: Decimal! + + """Currency of the money.""" + currencyCode: CurrencyCode! +} + +""" +A monetary value with currency. + +To format currencies, combine this type's amount and currencyCode fields with your client's locale. + +For example, in JavaScript you could use Intl.NumberFormat: + +```js +new Intl.NumberFormat(locale, { + style: 'currency', + currency: currencyCode +}).format(amount); +``` + +Other formatting libraries include: + +* iOS - [NumberFormatter](https://developer.apple.com/documentation/foundation/numberformatter) +* Android - [NumberFormat](https://developer.android.com/reference/java/text/NumberFormat.html) +* PHP - [NumberFormatter](http://php.net/manual/en/class.numberformatter.php) + +For a more general solution, the [Unicode CLDR number formatting database] is available with many implementations +(such as [TwitterCldr](https://github.com/twitter/twitter-cldr-rb)). + +""" +type MoneyV2 { + """Decimal money amount.""" + amount: Decimal! + + """Currency of the money.""" + currencyCode: CurrencyCode! +} + +""" +An auto-generated type for paginating through multiple MoneyV2s. + +""" +type MoneyV2Connection { + """A list of edges.""" + edges: [MoneyV2Edge!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one MoneyV2 and a cursor during pagination. + +""" +type MoneyV2Edge { + """A cursor for use in pagination.""" + cursor: String! + + """The item at the end of MoneyV2Edge.""" + node: MoneyV2! +} + +""" +The schema’s entry-point for mutations. This acts as the public, top-level API from which all mutation queries must start. +""" +type Mutation { + """Updates the attributes of a checkout.""" + checkoutAttributesUpdate( + """The ID of the checkout.""" + checkoutId: ID! + + """The fields used to update a checkout's attributes.""" + input: CheckoutAttributesUpdateInput! + ): CheckoutAttributesUpdatePayload @deprecated(reason: "Use `checkoutAttributesUpdateV2` instead") + + """Updates the attributes of a checkout.""" + checkoutAttributesUpdateV2( + """The ID of the checkout.""" + checkoutId: ID! + + """The checkout attributes to update.""" + input: CheckoutAttributesUpdateV2Input! + ): CheckoutAttributesUpdateV2Payload + + """ + Completes a checkout without providing payment information. You can use this + mutation for free items or items whose purchase price is covered by a gift card. + """ + checkoutCompleteFree( + """The ID of the checkout.""" + checkoutId: ID! + ): CheckoutCompleteFreePayload + + """Completes a checkout using a credit card token from Shopify's Vault.""" + checkoutCompleteWithCreditCard( + """The ID of the checkout.""" + checkoutId: ID! + + """The credit card info to apply as a payment.""" + payment: CreditCardPaymentInput! + ): CheckoutCompleteWithCreditCardPayload @deprecated(reason: "Use `checkoutCompleteWithCreditCardV2` instead") + + """ + Completes a checkout using a credit card token from Shopify's card vault. + Before you can complete checkouts using CheckoutCompleteWithCreditCardV2, you + need to [_request payment processing_](https://help.shopify.com/api/guides/sales-channel-sdk/getting-started#request-payment-processing). + """ + checkoutCompleteWithCreditCardV2( + """The ID of the checkout.""" + checkoutId: ID! + + """The credit card info to apply as a payment.""" + payment: CreditCardPaymentInputV2! + ): CheckoutCompleteWithCreditCardV2Payload + + """Completes a checkout with a tokenized payment.""" + checkoutCompleteWithTokenizedPayment( + """The ID of the checkout.""" + checkoutId: ID! + + """The info to apply as a tokenized payment.""" + payment: TokenizedPaymentInput! + ): CheckoutCompleteWithTokenizedPaymentPayload @deprecated(reason: "Use `checkoutCompleteWithTokenizedPaymentV2` instead") + + """Completes a checkout with a tokenized payment.""" + checkoutCompleteWithTokenizedPaymentV2( + """The ID of the checkout.""" + checkoutId: ID! + + """The info to apply as a tokenized payment.""" + payment: TokenizedPaymentInputV2! + ): CheckoutCompleteWithTokenizedPaymentV2Payload @deprecated(reason: "Use `checkoutCompleteWithTokenizedPaymentV3` instead") + + """Completes a checkout with a tokenized payment.""" + checkoutCompleteWithTokenizedPaymentV3( + """The ID of the checkout.""" + checkoutId: ID! + + """The info to apply as a tokenized payment.""" + payment: TokenizedPaymentInputV3! + ): CheckoutCompleteWithTokenizedPaymentV3Payload + + """Creates a new checkout.""" + checkoutCreate( + """The fields used to create a checkout.""" + input: CheckoutCreateInput! + ): CheckoutCreatePayload + + """Associates a customer to the checkout.""" + checkoutCustomerAssociate( + """The ID of the checkout.""" + checkoutId: ID! + + """The customer access token of the customer to associate.""" + customerAccessToken: String! + ): CheckoutCustomerAssociatePayload @deprecated(reason: "Use `checkoutCustomerAssociateV2` instead") + + """Associates a customer to the checkout.""" + checkoutCustomerAssociateV2( + """The ID of the checkout.""" + checkoutId: ID! + + """The customer access token of the customer to associate.""" + customerAccessToken: String! + ): CheckoutCustomerAssociateV2Payload + + """Disassociates the current checkout customer from the checkout.""" + checkoutCustomerDisassociate( + """The ID of the checkout.""" + checkoutId: ID! + ): CheckoutCustomerDisassociatePayload @deprecated(reason: "Use `checkoutCustomerDisassociateV2` instead") + + """Disassociates the current checkout customer from the checkout.""" + checkoutCustomerDisassociateV2( + """The ID of the checkout.""" + checkoutId: ID! + ): CheckoutCustomerDisassociateV2Payload + + """Applies a discount to an existing checkout using a discount code.""" + checkoutDiscountCodeApply( + """The discount code to apply to the checkout.""" + discountCode: String! + + """The ID of the checkout.""" + checkoutId: ID! + ): CheckoutDiscountCodeApplyPayload @deprecated(reason: "Use `checkoutDiscountCodeApplyV2` instead") + + """Applies a discount to an existing checkout using a discount code.""" + checkoutDiscountCodeApplyV2( + """The discount code to apply to the checkout.""" + discountCode: String! + + """The ID of the checkout.""" + checkoutId: ID! + ): CheckoutDiscountCodeApplyV2Payload + + """Removes the applied discount from an existing checkout.""" + checkoutDiscountCodeRemove( + """The ID of the checkout.""" + checkoutId: ID! + ): CheckoutDiscountCodeRemovePayload + + """Updates the email on an existing checkout.""" + checkoutEmailUpdate( + """The ID of the checkout.""" + checkoutId: ID! + + """The email to update the checkout with.""" + email: String! + ): CheckoutEmailUpdatePayload @deprecated(reason: "Use `checkoutEmailUpdateV2` instead") + + """Updates the email on an existing checkout.""" + checkoutEmailUpdateV2( + """The ID of the checkout.""" + checkoutId: ID! + + """The email to update the checkout with.""" + email: String! + ): CheckoutEmailUpdateV2Payload + + """ + Applies a gift card to an existing checkout using a gift card code. This will replace all currently applied gift cards. + """ + checkoutGiftCardApply( + """The code of the gift card to apply on the checkout.""" + giftCardCode: String! + + """The ID of the checkout.""" + checkoutId: ID! + ): CheckoutGiftCardApplyPayload @deprecated(reason: "Use `checkoutGiftCardsAppend` instead") + + """Removes an applied gift card from the checkout.""" + checkoutGiftCardRemove( + """The ID of the Applied Gift Card to remove from the Checkout.""" + appliedGiftCardId: ID! + + """The ID of the checkout.""" + checkoutId: ID! + ): CheckoutGiftCardRemovePayload @deprecated(reason: "Use `checkoutGiftCardRemoveV2` instead") + + """Removes an applied gift card from the checkout.""" + checkoutGiftCardRemoveV2( + """The ID of the Applied Gift Card to remove from the Checkout.""" + appliedGiftCardId: ID! + + """The ID of the checkout.""" + checkoutId: ID! + ): CheckoutGiftCardRemoveV2Payload + + """Appends gift cards to an existing checkout.""" + checkoutGiftCardsAppend( + """A list of gift card codes to append to the checkout.""" + giftCardCodes: [String!]! + + """The ID of the checkout.""" + checkoutId: ID! + ): CheckoutGiftCardsAppendPayload + + """Adds a list of line items to a checkout.""" + checkoutLineItemsAdd( + """A list of line item objects to add to the checkout.""" + lineItems: [CheckoutLineItemInput!]! + + """The ID of the checkout.""" + checkoutId: ID! + ): CheckoutLineItemsAddPayload + + """Removes line items from an existing checkout.""" + checkoutLineItemsRemove( + """The checkout on which to remove line items.""" + checkoutId: ID! + + """Line item ids to remove.""" + lineItemIds: [ID!]! + ): CheckoutLineItemsRemovePayload + + """Sets a list of line items to a checkout.""" + checkoutLineItemsReplace( + """A list of line item objects to set on the checkout.""" + lineItems: [CheckoutLineItemInput!]! + + """The ID of the checkout.""" + checkoutId: ID! + ): CheckoutLineItemsReplacePayload + + """Updates line items on a checkout.""" + checkoutLineItemsUpdate( + """The checkout on which to update line items.""" + checkoutId: ID! + + """Line items to update.""" + lineItems: [CheckoutLineItemUpdateInput!]! + ): CheckoutLineItemsUpdatePayload + + """Updates the shipping address of an existing checkout.""" + checkoutShippingAddressUpdate( + """The shipping address to where the line items will be shipped.""" + shippingAddress: MailingAddressInput! + + """The ID of the checkout.""" + checkoutId: ID! + ): CheckoutShippingAddressUpdatePayload @deprecated(reason: "Use `checkoutShippingAddressUpdateV2` instead") + + """Updates the shipping address of an existing checkout.""" + checkoutShippingAddressUpdateV2( + """The shipping address to where the line items will be shipped.""" + shippingAddress: MailingAddressInput! + + """The ID of the checkout.""" + checkoutId: ID! + ): CheckoutShippingAddressUpdateV2Payload + + """Updates the shipping lines on an existing checkout.""" + checkoutShippingLineUpdate( + """The ID of the checkout.""" + checkoutId: ID! + + """ + A unique identifier to a Checkout’s shipping provider, price, and title + combination, enabling the customer to select the availableShippingRates. + """ + shippingRateHandle: String! + ): CheckoutShippingLineUpdatePayload + + """ + Creates a customer access token. + The customer access token is required to modify the customer object in any way. + + """ + customerAccessTokenCreate( + """The fields used to create a customer access token.""" + input: CustomerAccessTokenCreateInput! + ): CustomerAccessTokenCreatePayload + + """ + Creates a customer access token using a multipass token instead of email and password. + A customer record is created if customer does not exist. If a customer record already + exists but the record is disabled, then it's enabled. + + """ + customerAccessTokenCreateWithMultipass( + """A valid multipass token to be authenticated.""" + multipassToken: String! + ): CustomerAccessTokenCreateWithMultipassPayload + + """Permanently destroys a customer access token.""" + customerAccessTokenDelete( + """The access token used to identify the customer.""" + customerAccessToken: String! + ): CustomerAccessTokenDeletePayload + + """ + Renews a customer access token. + + Access token renewal must happen *before* a token expires. + If a token has already expired, a new one should be created instead via `customerAccessTokenCreate`. + + """ + customerAccessTokenRenew( + """The access token used to identify the customer.""" + customerAccessToken: String! + ): CustomerAccessTokenRenewPayload + + """Activates a customer.""" + customerActivate( + """Specifies the customer to activate.""" + id: ID! + + """The fields used to activate a customer.""" + input: CustomerActivateInput! + ): CustomerActivatePayload + + """ + Activates a customer with the activation url received from `customerCreate`. + """ + customerActivateByUrl( + """The customer activation URL.""" + activationUrl: URL! + + """A new password set during activation.""" + password: String! + ): CustomerActivateByUrlPayload + + """Creates a new address for a customer.""" + customerAddressCreate( + """The access token used to identify the customer.""" + customerAccessToken: String! + + """The customer mailing address to create.""" + address: MailingAddressInput! + ): CustomerAddressCreatePayload + + """Permanently deletes the address of an existing customer.""" + customerAddressDelete( + """Specifies the address to delete.""" + id: ID! + + """The access token used to identify the customer.""" + customerAccessToken: String! + ): CustomerAddressDeletePayload + + """Updates the address of an existing customer.""" + customerAddressUpdate( + """The access token used to identify the customer.""" + customerAccessToken: String! + + """Specifies the customer address to update.""" + id: ID! + + """The customer’s mailing address.""" + address: MailingAddressInput! + ): CustomerAddressUpdatePayload + + """Creates a new customer.""" + customerCreate( + """The fields used to create a new customer.""" + input: CustomerCreateInput! + ): CustomerCreatePayload + + """Updates the default address of an existing customer.""" + customerDefaultAddressUpdate( + """The access token used to identify the customer.""" + customerAccessToken: String! + + """ID of the address to set as the new default for the customer.""" + addressId: ID! + ): CustomerDefaultAddressUpdatePayload + + """ + Sends a reset password email to the customer, as the first step in the reset password process. + """ + customerRecover( + """The email address of the customer to recover.""" + email: String! + ): CustomerRecoverPayload + + """ + Resets a customer’s password with a token received from `CustomerRecover`. + """ + customerReset( + """Specifies the customer to reset.""" + id: ID! + + """The fields used to reset a customer’s password.""" + input: CustomerResetInput! + ): CustomerResetPayload + + """ + Resets a customer’s password with the reset password url received from `CustomerRecover`. + """ + customerResetByUrl( + """The customer's reset password url.""" + resetUrl: URL! + + """New password that will be set as part of the reset password process.""" + password: String! + ): CustomerResetByUrlPayload + + """Updates an existing customer.""" + customerUpdate( + """The access token used to identify the customer.""" + customerAccessToken: String! + + """The customer object input.""" + customer: CustomerUpdateInput! + ): CustomerUpdatePayload +} + +"""An object with an ID to support global identification.""" +interface Node { + """Globally unique identifier.""" + id: ID! +} + +""" +An order is a customer’s completed request to purchase one or more products from +a shop. An order is created when a customer completes the checkout process, +during which time they provides an email address, billing address and payment information. +""" +type Order implements Node { + """ + The date and time when the order was canceled. Returns null if the order wasn't canceled. + """ + canceledAt: DateTime + + """ + The reason for the order's cancellation. Returns `null` if the order wasn't canceled. + """ + cancelReason: OrderCancelReason + + """The code of the currency used for the payment.""" + currencyCode: CurrencyCode! + + """ + The subtotal of line items and their discounts, excluding line items that have + been removed. Does not contain order-level discounts, duties, shipping costs, + or shipping discounts. Taxes are not included unless the order is a + taxes-included order. + """ + currentSubtotalPrice: MoneyV2! + + """The total cost of duties for the order, including refunds.""" + currentTotalDuties: MoneyV2 + + """ + The total amount of the order, including duties, taxes and discounts, minus amounts for line items that have been removed. + """ + currentTotalPrice: MoneyV2! + + """ + The total of all taxes applied to the order, excluding taxes for returned line items. + """ + currentTotalTax: MoneyV2! + + """The locale code in which this specific order happened.""" + customerLocale: String + + """The unique URL that the customer can use to access the order.""" + customerUrl: URL + + """Discounts that have been applied on the order.""" + discountApplications( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + ): DiscountApplicationConnection! + + """Whether the order has had any edits applied or not.""" + edited: Boolean! + + """The customer's email address.""" + email: String + + """The financial status of the order.""" + financialStatus: OrderFinancialStatus + + """The fulfillment status for the order.""" + fulfillmentStatus: OrderFulfillmentStatus! + + """Globally unique identifier.""" + id: ID! + + """List of the order’s line items.""" + lineItems( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + ): OrderLineItemConnection! + + """ + Unique identifier for the order that appears on the order. + For example, _#1000_ or _Store1001. + + """ + name: String! + + """ + A unique numeric identifier for the order for use by shop owner and customer. + """ + orderNumber: Int! + + """The total cost of duties charged at checkout.""" + originalTotalDuties: MoneyV2 + + """The total price of the order before any applied edits.""" + originalTotalPrice: MoneyV2! + + """The customer's phone number for receiving SMS notifications.""" + phone: String + + """ + The date and time when the order was imported. + This value can be set to dates in the past when importing from other systems. + If no value is provided, it will be auto-generated based on current date and time. + + """ + processedAt: DateTime! + + """The address to where the order will be shipped.""" + shippingAddress: MailingAddress + + """ + The discounts that have been allocated onto the shipping line by discount applications. + + """ + shippingDiscountAllocations: [DiscountAllocation!]! + + """The unique URL for the order's status page.""" + statusUrl: URL! + + """Price of the order before shipping and taxes.""" + subtotalPrice: Money @deprecated(reason: "Use `subtotalPriceV2` instead") + + """Price of the order before duties, shipping and taxes.""" + subtotalPriceV2: MoneyV2 + + """List of the order’s successful fulfillments.""" + successfulFulfillments( + """Truncate the array result to this size.""" + first: Int + ): [Fulfillment!] + + """ + The sum of all the prices of all the items in the order, taxes and discounts included (must be positive). + """ + totalPrice: Money! @deprecated(reason: "Use `totalPriceV2` instead") + + """ + The sum of all the prices of all the items in the order, duties, taxes and discounts included (must be positive). + """ + totalPriceV2: MoneyV2! + + """The total amount that has been refunded.""" + totalRefunded: Money! @deprecated(reason: "Use `totalRefundedV2` instead") + + """The total amount that has been refunded.""" + totalRefundedV2: MoneyV2! + + """The total cost of shipping.""" + totalShippingPrice: Money! @deprecated(reason: "Use `totalShippingPriceV2` instead") + + """The total cost of shipping.""" + totalShippingPriceV2: MoneyV2! + + """The total cost of taxes.""" + totalTax: Money @deprecated(reason: "Use `totalTaxV2` instead") + + """The total cost of taxes.""" + totalTaxV2: MoneyV2 +} + +"""Represents the reason for the order's cancellation.""" +enum OrderCancelReason { + """The customer wanted to cancel the order.""" + CUSTOMER + + """The order was fraudulent.""" + FRAUD + + """There was insufficient inventory.""" + INVENTORY + + """Payment was declined.""" + DECLINED + + """The order was canceled for an unlisted reason.""" + OTHER +} + +""" +An auto-generated type for paginating through multiple Orders. + +""" +type OrderConnection { + """A list of edges.""" + edges: [OrderEdge!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Order and a cursor during pagination. + +""" +type OrderEdge { + """A cursor for use in pagination.""" + cursor: String! + + """The item at the end of OrderEdge.""" + node: Order! +} + +"""Represents the order's current financial status.""" +enum OrderFinancialStatus { + """Displayed as **Pending**.""" + PENDING + + """Displayed as **Authorized**.""" + AUTHORIZED + + """Displayed as **Partially paid**.""" + PARTIALLY_PAID + + """Displayed as **Partially refunded**.""" + PARTIALLY_REFUNDED + + """Displayed as **Voided**.""" + VOIDED + + """Displayed as **Paid**.""" + PAID + + """Displayed as **Refunded**.""" + REFUNDED +} + +"""Represents the order's current fulfillment status.""" +enum OrderFulfillmentStatus { + """Displayed as **Unfulfilled**.""" + UNFULFILLED + + """Displayed as **Partially fulfilled**.""" + PARTIALLY_FULFILLED + + """Displayed as **Fulfilled**.""" + FULFILLED + + """Displayed as **Restocked**.""" + RESTOCKED + + """Displayed as **Pending fulfillment**.""" + PENDING_FULFILLMENT + + """Displayed as **Open**.""" + OPEN + + """Displayed as **In progress**.""" + IN_PROGRESS + + """Displayed as **Scheduled**.""" + SCHEDULED +} + +""" +Represents a single line in an order. There is one line item for each distinct product variant. +""" +type OrderLineItem { + """ + The number of entries associated to the line item minus the items that have been removed. + """ + currentQuantity: Int! + + """List of custom attributes associated to the line item.""" + customAttributes: [Attribute!]! + + """ + The discounts that have been allocated onto the order line item by discount applications. + """ + discountAllocations: [DiscountAllocation!]! + + """ + The total price of the line item, including discounts, and displayed in the presentment currency. + """ + discountedTotalPrice: MoneyV2! + + """ + The total price of the line item, not including any discounts. The total price + is calculated using the original unit price multiplied by the quantity, and it + is displayed in the presentment currency. + """ + originalTotalPrice: MoneyV2! + + """The number of products variants associated to the line item.""" + quantity: Int! + + """The title of the product combined with title of the variant.""" + title: String! + + """The product variant object associated to the line item.""" + variant: ProductVariant +} + +""" +An auto-generated type for paginating through multiple OrderLineItems. + +""" +type OrderLineItemConnection { + """A list of edges.""" + edges: [OrderLineItemEdge!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one OrderLineItem and a cursor during pagination. + +""" +type OrderLineItemEdge { + """A cursor for use in pagination.""" + cursor: String! + + """The item at the end of OrderLineItemEdge.""" + node: OrderLineItem! +} + +"""The set of valid sort keys for the Order query.""" +enum OrderSortKeys { + """Sort by the `processed_at` value.""" + PROCESSED_AT + + """Sort by the `total_price` value.""" + TOTAL_PRICE + + """Sort by the `id` value.""" + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + + """ + RELEVANCE +} + +""" +Shopify merchants can create pages to hold static HTML content. Each Page object +represents a custom page on the online store. +""" +type Page implements Node { + """The description of the page, complete with HTML formatting.""" + body: HTML! + + """Summary of the page body.""" + bodySummary: String! + + """The timestamp of the page creation.""" + createdAt: DateTime! + + """ + A human-friendly unique string for the page automatically generated from its title. + """ + handle: String! + + """Globally unique identifier.""" + id: ID! + + """The page's SEO information.""" + seo: SEO + + """The title of the page.""" + title: String! + + """The timestamp of the latest page update.""" + updatedAt: DateTime! + + """The url pointing to the page accessible from the web.""" + url: URL! +} + +""" +An auto-generated type for paginating through multiple Pages. + +""" +type PageConnection { + """A list of edges.""" + edges: [PageEdge!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Page and a cursor during pagination. + +""" +type PageEdge { + """A cursor for use in pagination.""" + cursor: String! + + """The item at the end of PageEdge.""" + node: Page! +} + +"""Information about pagination in a connection.""" +type PageInfo { + """Indicates if there are more pages to fetch.""" + hasNextPage: Boolean! + + """Indicates if there are any pages prior to the current page.""" + hasPreviousPage: Boolean! +} + +"""The set of valid sort keys for the Page query.""" +enum PageSortKeys { + """Sort by the `title` value.""" + TITLE + + """Sort by the `updated_at` value.""" + UPDATED_AT + + """Sort by the `id` value.""" + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + + """ + RELEVANCE +} + +"""A payment applied to a checkout.""" +type Payment implements Node { + """The amount of the payment.""" + amount: Money! @deprecated(reason: "Use `amountV2` instead") + + """The amount of the payment.""" + amountV2: MoneyV2! + + """The billing address for the payment.""" + billingAddress: MailingAddress + + """The checkout to which the payment belongs.""" + checkout: Checkout! + + """The credit card used for the payment in the case of direct payments.""" + creditCard: CreditCard + + """ + A message describing a processing error during asynchronous processing. + """ + errorMessage: String + + """Globally unique identifier.""" + id: ID! + + """ + A client-side generated token to identify a payment and perform idempotent operations. + For more information, refer to + [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests). + + """ + idempotencyKey: String + + """ + The URL where the customer needs to be redirected so they can complete the 3D Secure payment flow. + """ + nextActionUrl: URL + + """Whether or not the payment is still processing asynchronously.""" + ready: Boolean! + + """ + A flag to indicate if the payment is to be done in test mode for gateways that support it. + """ + test: Boolean! + + """ + The actual transaction recorded by Shopify after having processed the payment with the gateway. + """ + transaction: Transaction +} + +"""Settings related to payments.""" +type PaymentSettings { + """List of the card brands which the shop accepts.""" + acceptedCardBrands: [CardBrand!]! + + """The url pointing to the endpoint to vault credit cards.""" + cardVaultUrl: URL! + + """The country where the shop is located.""" + countryCode: CountryCode! + + """The three-letter code for the shop's primary currency.""" + currencyCode: CurrencyCode! + + """ + A list of enabled currencies (ISO 4217 format) that the shop accepts. + Merchants can enable currencies from their Shopify Payments settings in the Shopify admin. + """ + enabledPresentmentCurrencies: [CurrencyCode!]! + + """The shop’s Shopify Payments account id.""" + shopifyPaymentsAccountId: String + + """List of the digital wallets which the shop supports.""" + supportedDigitalWallets: [DigitalWallet!]! +} + +"""The valid values for the types of payment token.""" +enum PaymentTokenType { + """Apple Pay token type.""" + APPLE_PAY + + """Vault payment token type.""" + VAULT + + """Shopify Pay token type.""" + SHOPIFY_PAY + + """Google Pay token type.""" + GOOGLE_PAY +} + +"""The value of the percentage pricing object.""" +type PricingPercentageValue { + """The percentage value of the object.""" + percentage: Float! +} + +"""The price value (fixed or percentage) for a discount application.""" +union PricingValue = MoneyV2 | PricingPercentageValue + +""" +A product represents an individual item for sale in a Shopify store. Products are often physical, but they don't have to be. +For example, a digital download (such as a movie, music or ebook file) also +qualifies as a product, as do services (such as equipment rental, work for hire, +customization of another product or an extended warranty). +""" +type Product implements Node & HasMetafields { + """Indicates if at least one product variant is available for sale.""" + availableForSale: Boolean! + + """List of collections a product belongs to.""" + collections( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + ): CollectionConnection! + + """The compare at price of the product across all variants.""" + compareAtPriceRange: ProductPriceRange! + + """The date and time when the product was created.""" + createdAt: DateTime! + + """ + Stripped description of the product, single line with HTML tags removed. + """ + description( + """Truncates string after the given length.""" + truncateAt: Int + ): String! + + """The description of the product, complete with HTML formatting.""" + descriptionHtml: HTML! + + """ + A human-friendly unique string for the Product automatically generated from its title. + They are used by the Liquid templating language to refer to objects. + + """ + handle: String! + + """Globally unique identifier.""" + id: ID! + + """List of images associated with the product.""" + images( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + + """Sort the underlying list by the given key.""" + sortKey: ProductImageSortKeys = POSITION + + """ + Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead. + """ + maxWidth: Int + + """ + Image height in pixels between 1 and 2048. This argument is deprecated: Use + `maxHeight` on `Image.transformedSrc` instead. + """ + maxHeight: Int + + """ + Crops the image according to the specified region. This argument is + deprecated: Use `crop` on `Image.transformedSrc` instead. + """ + crop: CropRegion + + """ + Image size multiplier for high-resolution retina displays. Must be between 1 + and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead. + """ + scale: Int = 1 + ): ImageConnection! + + """The media associated with the product.""" + media( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + + """Sort the underlying list by the given key.""" + sortKey: ProductMediaSortKeys = POSITION + ): MediaConnection! + + """The metafield associated with the resource.""" + metafield( + """Container for a set of metafields (maximum of 20 characters).""" + namespace: String! + + """Identifier for the metafield (maximum of 30 characters).""" + key: String! + ): Metafield + + """A paginated list of metafields associated with the resource.""" + metafields( + """Container for a set of metafields (maximum of 20 characters).""" + namespace: String + + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + ): MetafieldConnection! + + """ + The online store URL for the product. + A value of `null` indicates that the product is not published to the Online Store sales channel. + + """ + onlineStoreUrl: URL + + """List of product options.""" + options( + """Truncate the array result to this size.""" + first: Int + ): [ProductOption!]! + + """List of price ranges in the presentment currencies for this shop.""" + presentmentPriceRanges( + """Specifies the presentment currencies to return a price range in.""" + presentmentCurrencies: [CurrencyCode!] + + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + ): ProductPriceRangeConnection! + + """The price range.""" + priceRange: ProductPriceRange! + + """ + A categorization that a product can be tagged with, commonly used for filtering and searching. + """ + productType: String! + + """The date and time when the product was published to the channel.""" + publishedAt: DateTime! + + """The product's SEO information.""" + seo: SEO! + + """ + A comma separated list of tags that have been added to the product. + Additional access scope required for private apps: unauthenticated_read_product_tags. + + """ + tags: [String!]! + + """The product’s title.""" + title: String! + + """The total quantity of inventory in stock for this Product.""" + totalInventory: Int + + """ + The date and time when the product was last modified. + A product's `updatedAt` value can change for different reasons. For example, if an order + is placed for a product that has inventory tracking set up, then the inventory adjustment + is counted as an update. + + """ + updatedAt: DateTime! + + """ + Find a product’s variant based on its selected options. + This is useful for converting a user’s selection of product options into a single matching variant. + If there is not a variant for the selected options, `null` will be returned. + + """ + variantBySelectedOptions( + """The input fields used for a selected option.""" + selectedOptions: [SelectedOptionInput!]! + ): ProductVariant + + """List of the product’s variants.""" + variants( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + + """Sort the underlying list by the given key.""" + sortKey: ProductVariantSortKeys = POSITION + ): ProductVariantConnection! + + """The product’s vendor name.""" + vendor: String! +} + +"""The set of valid sort keys for the ProductCollection query.""" +enum ProductCollectionSortKeys { + """Sort by the `title` value.""" + TITLE + + """Sort by the `price` value.""" + PRICE + + """Sort by the `best-selling` value.""" + BEST_SELLING + + """Sort by the `created` value.""" + CREATED + + """Sort by the `id` value.""" + ID + + """Sort by the `manual` value.""" + MANUAL + + """Sort by the `collection-default` value.""" + COLLECTION_DEFAULT + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + + """ + RELEVANCE +} + +""" +An auto-generated type for paginating through multiple Products. + +""" +type ProductConnection { + """A list of edges.""" + edges: [ProductEdge!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one Product and a cursor during pagination. + +""" +type ProductEdge { + """A cursor for use in pagination.""" + cursor: String! + + """The item at the end of ProductEdge.""" + node: Product! +} + +"""The set of valid sort keys for the ProductImage query.""" +enum ProductImageSortKeys { + """Sort by the `created_at` value.""" + CREATED_AT + + """Sort by the `position` value.""" + POSITION + + """Sort by the `id` value.""" + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + + """ + RELEVANCE +} + +"""The set of valid sort keys for the ProductMedia query.""" +enum ProductMediaSortKeys { + """Sort by the `position` value.""" + POSITION + + """Sort by the `id` value.""" + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + + """ + RELEVANCE +} + +""" +Product property names like "Size", "Color", and "Material" that the customers can select. +Variants are selected based on permutations of these options. +255 characters limit each. + +""" +type ProductOption implements Node { + """Globally unique identifier.""" + id: ID! + + """The product option’s name.""" + name: String! + + """The corresponding value to the product option name.""" + values: [String!]! +} + +"""The price range of the product.""" +type ProductPriceRange { + """The highest variant's price.""" + maxVariantPrice: MoneyV2! + + """The lowest variant's price.""" + minVariantPrice: MoneyV2! +} + +""" +An auto-generated type for paginating through multiple ProductPriceRanges. + +""" +type ProductPriceRangeConnection { + """A list of edges.""" + edges: [ProductPriceRangeEdge!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one ProductPriceRange and a cursor during pagination. + +""" +type ProductPriceRangeEdge { + """A cursor for use in pagination.""" + cursor: String! + + """The item at the end of ProductPriceRangeEdge.""" + node: ProductPriceRange! +} + +"""The set of valid sort keys for the Product query.""" +enum ProductSortKeys { + """Sort by the `title` value.""" + TITLE + + """Sort by the `product_type` value.""" + PRODUCT_TYPE + + """Sort by the `vendor` value.""" + VENDOR + + """Sort by the `updated_at` value.""" + UPDATED_AT + + """Sort by the `created_at` value.""" + CREATED_AT + + """Sort by the `best_selling` value.""" + BEST_SELLING + + """Sort by the `price` value.""" + PRICE + + """Sort by the `id` value.""" + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + + """ + RELEVANCE +} + +""" +A product variant represents a different version of a product, such as differing sizes or differing colors. +""" +type ProductVariant implements Node & HasMetafields { + """Indicates if the product variant is in stock.""" + available: Boolean @deprecated(reason: "Use `availableForSale` instead") + + """Indicates if the product variant is available for sale.""" + availableForSale: Boolean! + + """ + The compare at price of the variant. This can be used to mark a variant as on + sale, when `compareAtPrice` is higher than `price`. + """ + compareAtPrice: Money @deprecated(reason: "Use `compareAtPriceV2` instead") + + """ + The compare at price of the variant. This can be used to mark a variant as on + sale, when `compareAtPriceV2` is higher than `priceV2`. + """ + compareAtPriceV2: MoneyV2 + + """ + Whether a product is out of stock but still available for purchase (used for backorders). + """ + currentlyNotInStock: Boolean! + + """Globally unique identifier.""" + id: ID! + + """ + Image associated with the product variant. This field falls back to the product image if no image is available. + """ + image( + """ + Image width in pixels between 1 and 2048. This argument is deprecated: Use `maxWidth` on `Image.transformedSrc` instead. + """ + maxWidth: Int + + """ + Image height in pixels between 1 and 2048. This argument is deprecated: Use + `maxHeight` on `Image.transformedSrc` instead. + """ + maxHeight: Int + + """ + Crops the image according to the specified region. This argument is + deprecated: Use `crop` on `Image.transformedSrc` instead. + """ + crop: CropRegion + + """ + Image size multiplier for high-resolution retina displays. Must be between 1 + and 3. This argument is deprecated: Use `scale` on `Image.transformedSrc` instead. + """ + scale: Int = 1 + ): Image + + """The metafield associated with the resource.""" + metafield( + """Container for a set of metafields (maximum of 20 characters).""" + namespace: String! + + """Identifier for the metafield (maximum of 30 characters).""" + key: String! + ): Metafield + + """A paginated list of metafields associated with the resource.""" + metafields( + """Container for a set of metafields (maximum of 20 characters).""" + namespace: String + + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + ): MetafieldConnection! + + """ + List of prices and compare-at prices in the presentment currencies for this shop. + """ + presentmentPrices( + """The presentment currencies prices should return in.""" + presentmentCurrencies: [CurrencyCode!] + + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + ): ProductVariantPricePairConnection! + + """List of unit prices in the presentment currencies for this shop.""" + presentmentUnitPrices( + """Specify the currencies in which to return presentment unit prices.""" + presentmentCurrencies: [CurrencyCode!] + + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + ): MoneyV2Connection! + + """The product variant’s price.""" + price: Money! @deprecated(reason: "Use `priceV2` instead") + + """The product variant’s price.""" + priceV2: MoneyV2! + + """The product object that the product variant belongs to.""" + product: Product! + + """The total sellable quantity of the variant for online sales channels.""" + quantityAvailable: Int + + """ + Whether a customer needs to provide a shipping address when placing an order for the product variant. + """ + requiresShipping: Boolean! + + """List of product options applied to the variant.""" + selectedOptions: [SelectedOption!]! + + """The SKU (stock keeping unit) associated with the variant.""" + sku: String + + """The product variant’s title.""" + title: String! + + """ + The unit price value for the variant based on the variant's measurement. + """ + unitPrice: MoneyV2 + + """The unit price measurement for the variant.""" + unitPriceMeasurement: UnitPriceMeasurement + + """ + The weight of the product variant in the unit system specified with `weight_unit`. + """ + weight: Float + + """Unit of measurement for weight.""" + weightUnit: WeightUnit! +} + +""" +An auto-generated type for paginating through multiple ProductVariants. + +""" +type ProductVariantConnection { + """A list of edges.""" + edges: [ProductVariantEdge!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one ProductVariant and a cursor during pagination. + +""" +type ProductVariantEdge { + """A cursor for use in pagination.""" + cursor: String! + + """The item at the end of ProductVariantEdge.""" + node: ProductVariant! +} + +""" +The compare-at price and price of a variant sharing a currency. + +""" +type ProductVariantPricePair { + """The compare-at price of the variant with associated currency.""" + compareAtPrice: MoneyV2 + + """The price of the variant with associated currency.""" + price: MoneyV2! +} + +""" +An auto-generated type for paginating through multiple ProductVariantPricePairs. + +""" +type ProductVariantPricePairConnection { + """A list of edges.""" + edges: [ProductVariantPricePairEdge!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one ProductVariantPricePair and a cursor during pagination. + +""" +type ProductVariantPricePairEdge { + """A cursor for use in pagination.""" + cursor: String! + + """The item at the end of ProductVariantPricePairEdge.""" + node: ProductVariantPricePair! +} + +"""The set of valid sort keys for the ProductVariant query.""" +enum ProductVariantSortKeys { + """Sort by the `title` value.""" + TITLE + + """Sort by the `sku` value.""" + SKU + + """Sort by the `position` value.""" + POSITION + + """Sort by the `id` value.""" + ID + + """ + During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the + results by relevance to the search term(s). When no search query is specified, this sort key is not + deterministic and should not be used. + + """ + RELEVANCE +} + +""" +The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. +""" +type QueryRoot { + """List of the shop's articles.""" + articles( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + + """Sort the underlying list by the given key.""" + sortKey: ArticleSortKeys = ID + + """ + Supported filter parameters: + - `author` + - `blog_title` + - `created_at` + - `tag` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + + """ + query: String + ): ArticleConnection! + + """Find a blog by its handle.""" + blogByHandle( + """The handle of the blog.""" + handle: String! + ): Blog + + """List of the shop's blogs.""" + blogs( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + + """Sort the underlying list by the given key.""" + sortKey: BlogSortKeys = ID + + """ + Supported filter parameters: + - `created_at` + - `handle` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + + """ + query: String + ): BlogConnection! + + """Find a collection by its handle.""" + collectionByHandle( + """The handle of the collection.""" + handle: String! + ): Collection + + """List of the shop’s collections.""" + collections( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + + """Sort the underlying list by the given key.""" + sortKey: CollectionSortKeys = ID + + """ + Supported filter parameters: + - `collection_type` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + + """ + query: String + ): CollectionConnection! + + """Find a customer by its access token.""" + customer( + """The customer access token.""" + customerAccessToken: String! + ): Customer + + """Returns a specific node by ID.""" + node( + """The ID of the Node to return.""" + id: ID! + ): Node + + """Returns the list of nodes with the given IDs.""" + nodes( + """The IDs of the Nodes to return.""" + ids: [ID!]! + ): [Node]! + + """Find a page by its handle.""" + pageByHandle( + """The handle of the page.""" + handle: String! + ): Page + + """List of the shop's pages.""" + pages( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + + """Sort the underlying list by the given key.""" + sortKey: PageSortKeys = ID + + """ + Supported filter parameters: + - `created_at` + - `handle` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + + """ + query: String + ): PageConnection! + + """Find a product by its handle.""" + productByHandle( + """The handle of the product.""" + handle: String! + ): Product + + """ + Find recommended products related to a given `product_id`. + To learn more about how recommendations are generated, see + [*Showing product recommendations on product pages*](https://help.shopify.com/themes/development/recommended-products). + + """ + productRecommendations( + """The id of the product.""" + productId: ID! + ): [Product!] + + """List of the shop’s products.""" + products( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + + """Sort the underlying list by the given key.""" + sortKey: ProductSortKeys = ID + + """ + Supported filter parameters: + - `available_for_sale` + - `created_at` + - `product_type` + - `tag` + - `title` + - `updated_at` + - `variants.price` + - `vendor` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + + """ + query: String + ): ProductConnection! + + """ + Tags added to products. + Additional access scope required: unauthenticated_read_product_tags. + + """ + productTags( + """Returns up to the first `n` elements from the list.""" + first: Int! + ): StringConnection! + + """ + List of product types for the shop's products that are published to your app. + """ + productTypes( + """Returns up to the first `n` elements from the list.""" + first: Int! + ): StringConnection! + + """ + The list of public Storefront API versions, including supported, release candidate and unstable versions. + """ + publicApiVersions: [ApiVersion!]! + + """The shop associated with the storefront access token.""" + shop: Shop! +} + +""" +Script discount applications capture the intentions of a discount that +was created by a Shopify Script. + +""" +type ScriptDiscountApplication implements DiscountApplication { + """ + The method by which the discount's value is allocated to its entitled items. + """ + allocationMethod: DiscountApplicationAllocationMethod! + + """The description of the application as defined by the Script.""" + description: String! @deprecated(reason: "Use `title` instead") + + """Which lines of targetType that the discount is allocated over.""" + targetSelection: DiscountApplicationTargetSelection! + + """The type of line that the discount is applicable towards.""" + targetType: DiscountApplicationTargetType! + + """The title of the application as defined by the Script.""" + title: String! + + """The value of the discount application.""" + value: PricingValue! +} + +""" +Properties used by customers to select a product variant. +Products can have multiple options, like different sizes or colors. + +""" +type SelectedOption { + """The product option’s name.""" + name: String! + + """The product option’s value.""" + value: String! +} + +"""Specifies the input fields required for a selected option.""" +input SelectedOptionInput { + """The product option’s name.""" + name: String! + + """The product option’s value.""" + value: String! +} + +"""SEO information.""" +type SEO { + """The meta description.""" + description: String + + """The SEO title.""" + title: String +} + +"""A shipping rate to be applied to a checkout.""" +type ShippingRate { + """Human-readable unique identifier for this shipping rate.""" + handle: String! + + """Price of this shipping rate.""" + price: Money! @deprecated(reason: "Use `priceV2` instead") + + """Price of this shipping rate.""" + priceV2: MoneyV2! + + """Title of this shipping rate.""" + title: String! +} + +""" +Shop represents a collection of the general settings and information about the shop. +""" +type Shop { + """List of the shop' articles.""" + articles( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + + """Sort the underlying list by the given key.""" + sortKey: ArticleSortKeys = ID + + """ + Supported filter parameters: + - `author` + - `blog_title` + - `created_at` + - `tag` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + + """ + query: String + ): ArticleConnection! @deprecated(reason: "Use `QueryRoot.articles` instead.") + + """List of the shop' blogs.""" + blogs( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + + """Sort the underlying list by the given key.""" + sortKey: BlogSortKeys = ID + + """ + Supported filter parameters: + - `created_at` + - `handle` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + + """ + query: String + ): BlogConnection! @deprecated(reason: "Use `QueryRoot.blogs` instead.") + + """Find a collection by its handle.""" + collectionByHandle( + """The handle of the collection.""" + handle: String! + ): Collection @deprecated(reason: "Use `QueryRoot.collectionByHandle` instead.") + + """List of the shop’s collections.""" + collections( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + + """Sort the underlying list by the given key.""" + sortKey: CollectionSortKeys = ID + + """ + Supported filter parameters: + - `collection_type` + - `title` + - `updated_at` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + + """ + query: String + ): CollectionConnection! @deprecated(reason: "Use `QueryRoot.collections` instead.") + + """The three-letter code for the currency that the shop accepts.""" + currencyCode: CurrencyCode! @deprecated(reason: "Use `paymentSettings` instead") + + """A description of the shop.""" + description: String + + """ + A string representing the way currency is formatted when the currency isn’t specified. + """ + moneyFormat: String! + + """The shop’s name.""" + name: String! + + """Settings related to payments.""" + paymentSettings: PaymentSettings! + + """The shop’s primary domain.""" + primaryDomain: Domain! + + """The shop’s privacy policy.""" + privacyPolicy: ShopPolicy + + """Find a product by its handle.""" + productByHandle( + """The handle of the product.""" + handle: String! + ): Product @deprecated(reason: "Use `QueryRoot.productByHandle` instead.") + + """List of the shop’s products.""" + products( + """Returns up to the first `n` elements from the list.""" + first: Int + + """Returns the elements that come after the specified cursor.""" + after: String + + """Returns up to the last `n` elements from the list.""" + last: Int + + """Returns the elements that come before the specified cursor.""" + before: String + + """Reverse the order of the underlying list.""" + reverse: Boolean = false + + """Sort the underlying list by the given key.""" + sortKey: ProductSortKeys = ID + + """ + Supported filter parameters: + - `available_for_sale` + - `created_at` + - `product_type` + - `tag` + - `title` + - `updated_at` + - `variants.price` + - `vendor` + + See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax) + for more information about using filters. + + """ + query: String + ): ProductConnection! @deprecated(reason: "Use `QueryRoot.products` instead.") + + """ + A list of tags that have been added to products. + Additional access scope required: unauthenticated_read_product_tags. + + """ + productTags( + """Returns up to the first `n` elements from the list.""" + first: Int! + ): StringConnection! @deprecated(reason: "Use `QueryRoot.productTags` instead.") + + """List of the shop’s product types.""" + productTypes( + """Returns up to the first `n` elements from the list.""" + first: Int! + ): StringConnection! @deprecated(reason: "Use `QueryRoot.productTypes` instead.") + + """The shop’s refund policy.""" + refundPolicy: ShopPolicy + + """The shop’s shipping policy.""" + shippingPolicy: ShopPolicy + + """Countries that the shop ships to.""" + shipsToCountries: [CountryCode!]! + + """The shop’s Shopify Payments account id.""" + shopifyPaymentsAccountId: String @deprecated(reason: "Use `paymentSettings` instead") + + """The shop’s terms of service.""" + termsOfService: ShopPolicy +} + +""" +Policy that a merchant has configured for their store, such as their refund or privacy policy. +""" +type ShopPolicy implements Node { + """Policy text, maximum size of 64kb.""" + body: String! + + """Policy’s handle.""" + handle: String! + + """Globally unique identifier.""" + id: ID! + + """Policy’s title.""" + title: String! + + """Public URL to the policy.""" + url: URL! +} + +""" +An auto-generated type for paginating through multiple Strings. + +""" +type StringConnection { + """A list of edges.""" + edges: [StringEdge!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! +} + +""" +An auto-generated type which holds one String and a cursor during pagination. + +""" +type StringEdge { + """A cursor for use in pagination.""" + cursor: String! + + """The item at the end of StringEdge.""" + node: String! +} + +""" +Specifies the fields required to complete a checkout with +a tokenized payment. + +""" +input TokenizedPaymentInput { + """The amount of the payment.""" + amount: Money! + + """ + A unique client generated key used to avoid duplicate charges. When a + duplicate payment is found, the original is returned instead of creating a new + one. For more information, refer to [Idempotent + requests](https://shopify.dev/concepts/about-apis/idempotent-requests). + """ + idempotencyKey: String! + + """The billing address for the payment.""" + billingAddress: MailingAddressInput! + + """The type of payment token.""" + type: String! + + """ + A simple string or JSON containing the required payment data for the tokenized payment. + """ + paymentData: String! + + """Executes the payment in test mode if possible. Defaults to `false`.""" + test: Boolean = false + + """Public Hash Key used for AndroidPay payments only.""" + identifier: String +} + +""" +Specifies the fields required to complete a checkout with +a tokenized payment. + +""" +input TokenizedPaymentInputV2 { + """The amount and currency of the payment.""" + paymentAmount: MoneyInput! + + """ + A unique client generated key used to avoid duplicate charges. When a + duplicate payment is found, the original is returned instead of creating a new + one. For more information, refer to [Idempotent + requests](https://shopify.dev/concepts/about-apis/idempotent-requests). + """ + idempotencyKey: String! + + """The billing address for the payment.""" + billingAddress: MailingAddressInput! + + """ + A simple string or JSON containing the required payment data for the tokenized payment. + """ + paymentData: String! + + """ + Whether to execute the payment in test mode, if possible. Test mode is not + supported in production stores. Defaults to `false`. + """ + test: Boolean = false + + """Public Hash Key used for AndroidPay payments only.""" + identifier: String + + """The type of payment token.""" + type: String! +} + +""" +Specifies the fields required to complete a checkout with +a tokenized payment. + +""" +input TokenizedPaymentInputV3 { + """The amount and currency of the payment.""" + paymentAmount: MoneyInput! + + """ + A unique client generated key used to avoid duplicate charges. When a + duplicate payment is found, the original is returned instead of creating a new + one. For more information, refer to [Idempotent + requests](https://shopify.dev/concepts/about-apis/idempotent-requests). + """ + idempotencyKey: String! + + """The billing address for the payment.""" + billingAddress: MailingAddressInput! + + """ + A simple string or JSON containing the required payment data for the tokenized payment. + """ + paymentData: String! + + """ + Whether to execute the payment in test mode, if possible. Test mode is not + supported in production stores. Defaults to `false`. + """ + test: Boolean = false + + """Public Hash Key used for AndroidPay payments only.""" + identifier: String + + """The type of payment token.""" + type: PaymentTokenType! +} + +"""An object representing exchange of money for a product or service.""" +type Transaction { + """The amount of money that the transaction was for.""" + amount: Money! @deprecated(reason: "Use `amountV2` instead") + + """The amount of money that the transaction was for.""" + amountV2: MoneyV2! + + """The kind of the transaction.""" + kind: TransactionKind! + + """The status of the transaction.""" + status: TransactionStatus! @deprecated(reason: "Use `statusV2` instead") + + """The status of the transaction.""" + statusV2: TransactionStatus + + """Whether the transaction was done in test mode or not.""" + test: Boolean! +} + +"""The different kinds of order transactions.""" +enum TransactionKind { + """An authorization and capture performed together in a single step.""" + SALE + + """ + A transfer of the money that was reserved during the authorization stage. + """ + CAPTURE + + """ + An amount reserved against the cardholder's funding source. + Money does not change hands until the authorization is captured. + + """ + AUTHORIZATION + + """An authorization for a payment taken with an EMV credit card reader.""" + EMV_AUTHORIZATION + + """Money returned to the customer when they have paid too much.""" + CHANGE +} + +"""Transaction statuses describe the status of a transaction.""" +enum TransactionStatus { + """The transaction is pending.""" + PENDING + + """The transaction succeeded.""" + SUCCESS + + """The transaction failed.""" + FAILURE + + """There was an error while processing the transaction.""" + ERROR +} + +""" +The measurement used to calculate a unit price for a product variant (e.g. $9.99 / 100ml). + +""" +type UnitPriceMeasurement { + """The type of unit of measurement for the unit price measurement.""" + measuredType: UnitPriceMeasurementMeasuredType + + """The quantity unit for the unit price measurement.""" + quantityUnit: UnitPriceMeasurementMeasuredUnit + + """The quantity value for the unit price measurement.""" + quantityValue: Float! + + """The reference unit for the unit price measurement.""" + referenceUnit: UnitPriceMeasurementMeasuredUnit + + """The reference value for the unit price measurement.""" + referenceValue: Int! +} + +"""The accepted types of unit of measurement.""" +enum UnitPriceMeasurementMeasuredType { + """Unit of measurements representing volumes.""" + VOLUME + + """Unit of measurements representing weights.""" + WEIGHT + + """Unit of measurements representing lengths.""" + LENGTH + + """Unit of measurements representing areas.""" + AREA +} + +"""The valid units of measurement for a unit price measurement.""" +enum UnitPriceMeasurementMeasuredUnit { + """1000 milliliters equals 1 liter.""" + ML + + """100 centiliters equals 1 liter.""" + CL + + """Metric system unit of volume.""" + L + + """1 cubic meter equals 1000 liters.""" + M3 + + """1000 milligrams equals 1 gram.""" + MG + + """Metric system unit of weight.""" + G + + """1 kilogram equals 1000 grams.""" + KG + + """1000 millimeters equals 1 meter.""" + MM + + """100 centimeters equals 1 meter.""" + CM + + """Metric system unit of length.""" + M + + """Metric system unit of area.""" + M2 +} + +""" +An RFC 3986 and RFC 3987 compliant URI string. + +Example value: `"https://johns-apparel.myshopify.com"`. + +""" +scalar URL + +"""Represents an error in the input of a mutation.""" +type UserError implements DisplayableError { + """Path to the input field which caused the error.""" + field: [String!] + + """The error message.""" + message: String! +} + +"""Represents a Shopify hosted video.""" +type Video implements Node & Media { + """A word or phrase to share the nature or contents of a media.""" + alt: String + + """Globally unique identifier.""" + id: ID! + + """The media content type.""" + mediaContentType: MediaContentType! + + """The preview image for the media.""" + previewImage: Image + + """The sources for a video.""" + sources: [VideoSource!]! +} + +"""Represents a source for a Shopify hosted video.""" +type VideoSource { + """The format of the video source.""" + format: String! + + """The height of the video.""" + height: Int! + + """The video MIME type.""" + mimeType: String! + + """The URL of the video.""" + url: String! + + """The width of the video.""" + width: Int! +} + +"""Units of measurement for weight.""" +enum WeightUnit { + """1 kilogram equals 1000 grams.""" + KILOGRAMS + + """Metric system unit of mass.""" + GRAMS + + """1 pound equals 16 ounces.""" + POUNDS + + """Imperial system unit of mass.""" + OUNCES +} diff --git a/example/shopify/unions.md b/example/shopify/unions.md new file mode 100644 index 0000000000000..eaa06fa82bbbd --- /dev/null +++ b/example/shopify/unions.md @@ -0,0 +1,29 @@ +# Unions + +### About unions + +A [union](https://graphql.github.io/graphql-spec/June2018/#sec-Unions) is a type of object representing many objects. + +### MetafieldParentResource + +A resource that the metafield belongs to. + +### Possible types + + +- [Product](objects.md#product) +- [ProductVariant](objects.md#productvariant) + +--- + +### PricingValue + +The price value (fixed or percentage) for a discount application. + +### Possible types + + +- [MoneyV2](objects.md#moneyv2) +- [PricingPercentageValue](objects.md#pricingpercentagevalue) + +--- \ No newline at end of file diff --git a/go.mod b/go.mod index c2a9ac19bb3b4..6e6b1f45a46cb 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.16 require ( github.com/99designs/gqlgen v0.13.0 + github.com/google/go-cmp v0.5.5 github.com/machinebox/graphql v0.2.2 github.com/matryer/is v1.4.0 // indirect github.com/mattn/go-zglob v0.0.3 diff --git a/go.sum b/go.sum index 7b66022a7b953..b0521817590e2 100644 --- a/go.sum +++ b/go.sum @@ -17,6 +17,8 @@ github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c h1:TUuUh0Xgj97tLMN github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/go-chi/chi v3.3.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -77,6 +79,8 @@ golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190515012406-7d7faa4812bd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20200114235610-7ae403b6b589/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/internal/gqlgen/gqlgen.go b/internal/gqlgen/gqlgen.go index 1a50867e8e0de..c067ff6fc5f51 100644 --- a/internal/gqlgen/gqlgen.go +++ b/internal/gqlgen/gqlgen.go @@ -1,11 +1,11 @@ -// Almost Code generated by github.com/99designs/gqlgen package gqlgen import ( "bytes" "context" - "errors" + "fmt" "io/ioutil" + "reflect" "strconv" "sync" @@ -15,9 +15,6 @@ import ( "github.com/vektah/gqlparser/v2/ast" ) -// region ************************** generated!.gotpl ************************** - -// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. func NewExecutableSchema(filenames ...string) (graphql.ExecutableSchema, error) { sources := make([]*ast.Source, len(filenames)) for i, filename := range filenames { @@ -70,31 +67,20 @@ type executionContext struct { *executableSchema } -func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapSchema(ec.parsedSchema), nil +func (ec *executionContext) introspectSchema() *introspection.Schema { + return introspection.WrapSchema(ec.parsedSchema) } -func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapTypeFromDef(ec.parsedSchema, ec.parsedSchema.Types[name]), nil +func (ec *executionContext) introspectType(name string) *introspection.Type { + return introspection.WrapTypeFromDef(ec.parsedSchema, ec.parsedSchema.Types[name]) } -// endregion ************************** generated!.gotpl ************************** - -// region ***************************** args.gotpl ***************************** - func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} var arg0 string if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) + arg0, err = graphql.UnmarshalString(tmp) if err != nil { return nil, err } @@ -108,8 +94,7 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + arg0, err = graphql.UnmarshalBoolean(tmp) if err != nil { return nil, err } @@ -123,8 +108,7 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg args := map[string]interface{}{} var arg0 bool if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + arg0, err = graphql.UnmarshalBoolean(tmp) if err != nil { return nil, err } @@ -133,1189 +117,221 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg return args, nil } -// endregion ***************************** args.gotpl ***************************** - -// region ************************** directives.gotpl ************************** - -// endregion ************************** directives.gotpl ************************** - -// region **************************** field.gotpl ***************************** - func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) rawArgs := field.ArgumentMap(ec.Variables) args, err := ec.field_Query___type_args(ctx, rawArgs) if err != nil { ec.Error(ctx, err) return graphql.Null } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.introspectType(args["name"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + + res := ec.introspectType(args["name"].(string)) + return ec.marshalType(ctx, field.Selections, res) } func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Schema) - fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) + res := ec.introspectSchema() + return ec.___Schema(ctx, field.Selections, res) } func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + res := obj.Name + return graphql.MarshalString(res) } func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + res := obj.Description + return graphql.MarshalString(res) } func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Locations, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) + res := obj.Locations + return ec.marshalArray(ctx, field.Selections, res) } func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Args, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.InputValue) - fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + res := obj.Args + return ec.marshalArray(ctx, field.Selections, res) } func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + res := obj.Name + return graphql.MarshalString(res) } func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + res := obj.Description + return graphql.MarshalString(res) } func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + res := obj.IsDeprecated() + return graphql.MarshalBoolean(res) } func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil - }) - if err != nil { - ec.Error(ctx, err) + res := obj.DeprecationReason() + if res == nil { return graphql.Null } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return graphql.MarshalString(*res) } func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + res := obj.Name + return graphql.MarshalString(res) } func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + res := obj.Description + return graphql.MarshalString(res) } func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Args, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.InputValue) - fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + res := obj.Args + return ec.marshalArray(ctx, field.Selections, res) } func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Type, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } + res := obj.Type + if res == nil { return graphql.Null } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.___Type(ctx, field.Selections, res) } func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + res := obj.IsDeprecated() + return graphql.MarshalBoolean(res) } func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil - }) - if err != nil { - ec.Error(ctx, err) + res := obj.DeprecationReason() + if res == nil { return graphql.Null } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return graphql.MarshalString(*res) } func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + res := obj.Name + return graphql.MarshalString(res) } func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + res := obj.Description + return graphql.MarshalString(res) } func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Type, nil - }) - if err != nil { - ec.Error(ctx, err) + res := obj.Type + if res == nil { return graphql.Null } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.___Type(ctx, field.Selections, res) } func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DefaultValue, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { + res := obj.DefaultValue + if res == nil { return graphql.Null } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return graphql.MarshalString(*res) } func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Types(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + res := obj.Types() + return ec.marshalArray(ctx, field.Selections, res) } func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.QueryType(), nil - }) - if err != nil { - ec.Error(ctx, err) + res := obj.QueryType() + if res == nil { return graphql.Null } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.___Type(ctx, field.Selections, res) } func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MutationType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + res := obj.MutationType() + return ec.marshalType(ctx, field.Selections, res) } func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SubscriptionType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + res := obj.SubscriptionType() + return ec.marshalType(ctx, field.Selections, res) } func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Directives(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.Directive) - fc.Result = res - return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) + res := obj.Directives() + return ec.marshalArray(ctx, field.Selections, res) } func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalN__TypeKind2string(ctx, field.Selections, res) + res := obj.Kind() + return graphql.MarshalString(res) } func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name(), nil - }) - if err != nil { - ec.Error(ctx, err) + res := obj.Name() + if res == nil { return graphql.Null } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return graphql.MarshalString(*res) } func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + res := obj.Description() + return graphql.MarshalString(res) } func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) rawArgs := field.ArgumentMap(ec.Variables) args, err := ec.field___Type_fields_args(ctx, rawArgs) if err != nil { ec.Error(ctx, err) return graphql.Null } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Fields(args["includeDeprecated"].(bool)), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Field) - fc.Result = res - return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) + + res := obj.Fields(args["includeDeprecated"].(bool)) + return ec.marshalArray(ctx, field.Selections, res) } func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Interfaces(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + res := obj.Interfaces() + return ec.marshalArray(ctx, field.Selections, res) } func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PossibleTypes(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + res := obj.PossibleTypes() + return ec.marshalArray(ctx, field.Selections, res) } func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) rawArgs := field.ArgumentMap(ec.Variables) args, err := ec.field___Type_enumValues_args(ctx, rawArgs) if err != nil { ec.Error(ctx, err) return graphql.Null } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EnumValues(args["includeDeprecated"].(bool)), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.EnumValue) - fc.Result = res - return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.InputFields(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.InputValue) - fc.Result = res - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.OfType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + res := obj.EnumValues(args["includeDeprecated"].(bool)) + return ec.marshalArray(ctx, field.Selections, res) } -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -// endregion **************************** input.gotpl ***************************** - -// region ************************** interface.gotpl *************************** - -// endregion ************************** interface.gotpl *************************** - -// region **************************** object.gotpl **************************** +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + res := obj.InputFields() + return ec.marshalArray(ctx, field.Selections, res) +} -var queryImplementors = []string{"Query"} +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + res := obj.OfType() + return ec.marshalType(ctx, field.Selections, res) +} func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ - Object: "Query", - }) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -1337,8 +353,6 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } -var __DirectiveImplementors = []string{"__Directive"} - func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) @@ -1376,8 +390,6 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS return out } -var __EnumValueImplementors = []string{"__EnumValue"} - func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) @@ -1412,8 +424,6 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS return out } -var __FieldImplementors = []string{"__Field"} - func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) @@ -1458,8 +468,6 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, return out } -var __InputValueImplementors = []string{"__InputValue"} - func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) @@ -1494,8 +502,6 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection return out } -var __SchemaImplementors = []string{"__Schema"} - func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) @@ -1535,8 +541,6 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, return out } -var __TypeImplementors = []string{"__Type"} - func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) @@ -1578,487 +582,46 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o return out } -// endregion **************************** object.gotpl **************************** - -// region ***************************** type.gotpl ***************************** - -func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - res := graphql.MarshalBoolean(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalID(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalID(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { - return ec.___Directive(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - return ret -} - -func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - var vSlice []interface{} - if v != nil { - if tmp1, ok := v.([]interface{}); ok { - vSlice = tmp1 - } else { - vSlice = []interface{}{v} - } - } - var err error - res := make([]string, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - return ret -} - -func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { - return ec.___EnumValue(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { - return ec.___Field(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { - return ec.___InputValue(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - return ret -} - -func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { - return ec.___Type(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - return ret -} - -func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - return ec.___Type(ctx, sel, v) -} - -func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - } - return res -} - -func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - return graphql.MarshalBoolean(v) -} - -func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return graphql.MarshalBoolean(*v) -} - -func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - return graphql.MarshalString(v) -} - -func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalString(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return graphql.MarshalString(*v) -} - -func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - return ret -} - -func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) +func (ec *executionContext) marshalArray(ctx context.Context, sel ast.SelectionSet, v interface{}) graphql.Marshaler { + if reflect.TypeOf(v).Kind() != reflect.Slice { + panic("expected slice type") } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } + slice := reflect.ValueOf(v) + len := slice.Len() + if len == 0 { + return graphql.Array{} } - wg.Wait() - return ret -} -func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) + ret := make(graphql.Array, len) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := len == 1 if !isLen1 { - wg.Add(len(v)) + wg.Add(len) } - for i := range v { + for i := 0; i < len; i++ { i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) + v := slice.Index(i).Interface() f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - return ret -} - -func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec.___Schema(ctx, sel, v) -} - -func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() + switch typ := v.(type) { + case introspection.Type: + ret[i] = ec.___Type(ctx, sel, &typ) + case introspection.Directive: + ret[i] = ec.___Directive(ctx, sel, &typ) + case introspection.InputValue: + ret[i] = ec.___InputValue(ctx, sel, &typ) + case introspection.Field: + ret[i] = ec.___Field(ctx, sel, &typ) + case introspection.EnumValue: + ret[i] = ec.___EnumValue(ctx, sel, &typ) + case string: + ret[i] = graphql.MarshalString(typ) + default: + panic(fmt.Sprintf("unknown type %T", typ)) } - ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) } if isLen1 { f(i) @@ -2071,11 +634,9 @@ func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen return ret } -func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { +func (ec *executionContext) marshalType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { if v == nil { return graphql.Null } return ec.___Type(ctx, sel, v) } - -// endregion ***************************** type.gotpl ***************************** diff --git a/internal/gqlgen/gqlgen_deprecated.go b/internal/gqlgen/gqlgen_deprecated.go new file mode 100644 index 0000000000000..87bf33e16db48 --- /dev/null +++ b/internal/gqlgen/gqlgen_deprecated.go @@ -0,0 +1,2081 @@ +// Almost Code generated by github.com/99designs/gqlgen +package gqlgen + +import ( + "bytes" + "context" + "errors" + "io/ioutil" + "strconv" + "sync" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" +) + +// region ************************** generated!.gotpl ************************** + +// __deprecated_NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +func __deprecated_NewExecutableSchema(filenames ...string) (graphql.ExecutableSchema, error) { + sources := make([]*ast.Source, len(filenames)) + for i, filename := range filenames { + body, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + sources[i] = &ast.Source{ + Name: filename, + Input: string(body), + } + } + AST, err := gqlparser.LoadSchema(sources...) + if err != nil { + return nil, err + } + return &__deprecated_executableSchema{ + parsedSchema: AST, + }, nil +} + +type __deprecated_executableSchema struct { + parsedSchema *ast.Schema +} + +func (e *__deprecated_executableSchema) Schema() *ast.Schema { + return e.parsedSchema +} + +func (e *__deprecated_executableSchema) Complexity(typeName, fieldName string, childComplexity int, args map[string]interface{}) (int, bool) { + return 0, false +} + +func (e *__deprecated_executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + rc := graphql.GetOperationContext(ctx) + ec := __deprecated_executionContext{rc, e} + return func(ctx context.Context) *graphql.Response { + data := ec._Query(ctx, rc.Operation.SelectionSet) + var buf bytes.Buffer + data.MarshalGQL(&buf) + + return &graphql.Response{ + Data: buf.Bytes(), + } + } +} + +type __deprecated_executionContext struct { + *graphql.OperationContext + *__deprecated_executableSchema +} + +func (ec *__deprecated_executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(ec.parsedSchema), nil +} + +func (ec *__deprecated_executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(ec.parsedSchema, ec.parsedSchema.Types[name]), nil +} + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *__deprecated_executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg0 + return args, nil +} + +func (ec *__deprecated_executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil +} + +func (ec *__deprecated_executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *__deprecated_executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Query___type_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field___Type_fields_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field___Type_enumValues_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *__deprecated_executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var queryImplementors = []string{"Query"} + +func (ec *__deprecated_executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "__type": + out.Values[i] = ec._Query___type(ctx, field) + case "__schema": + out.Values[i] = ec._Query___schema(ctx, field) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __DirectiveImplementors = []string{"__Directive"} + +func (ec *__deprecated_executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *__deprecated_executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __FieldImplementors = []string{"__Field"} + +func (ec *__deprecated_executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __InputValueImplementors = []string{"__InputValue"} + +func (ec *__deprecated_executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __SchemaImplementors = []string{"__Schema"} + +func (ec *__deprecated_executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Schema") + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __TypeImplementors = []string{"__Type"} + +func (ec *__deprecated_executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +// endregion **************************** object.gotpl **************************** + +// region ***************************** type.gotpl ***************************** + +func (ec *__deprecated_executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *__deprecated_executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *__deprecated_executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *__deprecated_executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalID(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *__deprecated_executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *__deprecated_executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *__deprecated_executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} + +func (ec *__deprecated_executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *__deprecated_executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *__deprecated_executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *__deprecated_executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *__deprecated_executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *__deprecated_executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} + +func (ec *__deprecated_executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} + +func (ec *__deprecated_executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +func (ec *__deprecated_executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *__deprecated_executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} + +func (ec *__deprecated_executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *__deprecated_executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +func (ec *__deprecated_executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *__deprecated_executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *__deprecated_executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *__deprecated_executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + return graphql.MarshalBoolean(v) +} + +func (ec *__deprecated_executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *__deprecated_executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return graphql.MarshalBoolean(*v) +} + +func (ec *__deprecated_executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *__deprecated_executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + return graphql.MarshalString(v) +} + +func (ec *__deprecated_executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *__deprecated_executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return graphql.MarshalString(*v) +} + +func (ec *__deprecated_executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *__deprecated_executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *__deprecated_executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *__deprecated_executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + +func (ec *__deprecated_executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *__deprecated_executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +// endregion ***************************** type.gotpl ***************************** diff --git a/internal/gqlgen/gqlgen_test.go b/internal/gqlgen/gqlgen_test.go new file mode 100644 index 0000000000000..4be1698dd3e00 --- /dev/null +++ b/internal/gqlgen/gqlgen_test.go @@ -0,0 +1,97 @@ +package gqlgen_test + +import ( + "context" + "encoding/json" + "path/filepath" + "testing" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/executor" + "github.com/Code-Hex/gqldoc/internal/gqlgen" + "github.com/Code-Hex/gqldoc/internal/introspection" + "github.com/Code-Hex/gqldoc/loader" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" +) + +func TestGitHubSchema(t *testing.T) { + schema := filepath.Join("..", "..", "example", "github", "schema.graphql") + root, err := loader.LoadSchema(schema) + if err != nil { + t.Fatal(err) + } + + root2, err := LoadSchema(schema) + if err != nil { + t.Fatal(err) + } + + if diff := cmp.Diff(root2, root, cmpopts.IgnoreUnexported(introspection.Schema{})); diff != "" { + t.Fatalf("-want, +got\n%s", diff) + } +} + +func TestStarwarsSchema(t *testing.T) { + schema := filepath.Join("..", "..", "example", "starwars", "schema.graphql") + root, err := loader.LoadSchema(schema) + if err != nil { + t.Fatal(err) + } + + root2, err := LoadSchema(schema) + if err != nil { + t.Fatal(err) + } + + if diff := cmp.Diff(root2, root, cmpopts.IgnoreUnexported(introspection.Schema{})); diff != "" { + t.Fatalf("-want, +got\n%s", diff) + } +} + +func TestShopifySchema(t *testing.T) { + schema := filepath.Join("..", "..", "example", "shopify", "schema.graphql") + root, err := loader.LoadSchema(schema) + if err != nil { + t.Fatal(err) + } + + root2, err := LoadSchema(schema) + if err != nil { + t.Fatal(err) + } + + if diff := cmp.Diff(root2, root, cmpopts.IgnoreUnexported(introspection.Schema{})); diff != "" { + t.Fatalf("-want, +got\n%s", diff) + } +} + +func LoadSchema(filenames ...string) (*introspection.Root, error) { + es, err := gqlgen.Deprecated_NewExecutableSchema(filenames...) + if err != nil { + return nil, errors.WithStack(err) + } + + // Set time for tracing + ctx := graphql.StartOperationTrace(context.Background()) + + exec := executor.New(es) + oc, err := exec.CreateOperationContext(ctx, &graphql.RawParams{ + Query: introspection.Query, + }) + // Need to do introspection + oc.DisableIntrospection = false + + responses, ctx := exec.DispatchOperation(ctx, oc) + resp := responses(ctx) + if len(resp.Errors) > 0 { + return nil, resp.Errors + } + + var res introspection.Root + if err := json.Unmarshal(resp.Data, &res); err != nil { + return nil, err + } + return &res, nil +} diff --git a/internal/gqlgen/utils_for_test.go b/internal/gqlgen/utils_for_test.go new file mode 100644 index 0000000000000..29b42baba2fee --- /dev/null +++ b/internal/gqlgen/utils_for_test.go @@ -0,0 +1,3 @@ +package gqlgen + +var Deprecated_NewExecutableSchema = __deprecated_NewExecutableSchema |