You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi ! I'm getting some issues generating my types. Note than the request itself works perfectly, it's just about types generations. If i comment the delivery / discountApplication parts, it works. Could anyone help ? thanks a lot !
`Generate to ./src/platform/shopifyv2/storefront-types/storefront.generated.ts
✔ Load GraphQL schemas
✔ Load GraphQL documents
✖ GraphQL Document Validation failed with 4 errors;
Error 0: Cannot query field "delivery" on type "Cart".
at /src/platform/shopifyv2/commons/mutations/create-cart.ts:23:11
Error 1: Unknown type "CartDeliveryAddress". Did you mean "DeliveryAddress", "CartDeliveryGroup", "CartDeliveryOption", "CartDeliveryGroupEdge", or …
at /shopifyv2/commons/mutations/create-cart.ts:26:23
Error 2: Cannot query field "discountApplication" on type "CartCodeDiscountAllocation".
at /shopifyv2/commons/mutations/create-cart.ts:44:8
Error 3: Cannot query field "discountApplication" on type "CartCodeDiscountAllocation".
at /shopifyv2/commons/mutations/create-cart.ts:98:11`
here is my conf :
and here is my mutation query cart :
export const createCartMutation = `#graphql
mutation cartCreate($input: CartInput!) {
cartCreate(input: $input) {
cart {
id
appliedGiftCards {
amountUsed {
amount
currencyCode
}
lastCharacters
id
}
attributes {
key
value
}
checkoutUrl
buyerIdentity {
email
phone
}
delivery {
addresses {
address {
... on CartDeliveryAddress {
address1
address2
city
countryCode
firstName
lastName
phone
provinceCode
zip
}
}
}
}
discountAllocations {
... on CartCodeDiscountAllocation {
__typename
code
discountApplication {
targetSelection
value {
... on MoneyV2 {
__typename
amount
currencyCode
}
... on PricingPercentageValue {
__typename
percentage
}
}
}
}
targetType
}
discountCodes {
applicable
code
}
deliveryGroups(first: 50) {
edges {
node {
id
deliveryOptions {
handle
title
estimatedCost {
amount
}
}
selectedDeliveryOption {
handle
title
estimatedCost {
amount
}
}
}
}
}
lines(first: 10) {
edges {
node {
id
quantity
attributes {
key
value
}
discountAllocations {
targetType
... on CartCodeDiscountAllocation {
discountApplication {
targetSelection
value {
... on MoneyV2 {
amount
currencyCode
}
... on PricingPercentageValue {
percentage
}
}
}
}
}
merchandise {
__typename
... on ProductVariant {
__typename
title
sku
id
quantityAvailable
availableForSale
product {
title
id
}
compareAtPrice {
amount
currencyCode
}
price {
amount
currencyCode
}
requiresShipping
image {
url
}
selectedOptions {
value
name
}
components(first: 10) {
edges {
node {
quantity
productVariant {
compareAtPrice {
amount
currencyCode
}
product {
title
id
}
title
price {
amount
currencyCode
}
}
}
}
}
}
}
}
}
}
cost {
totalAmount {
amount
currencyCode
}
subtotalAmount {
amount
}
checkoutChargeAmount {
amount
}
totalAmountEstimated
subtotalAmountEstimated
}
}
userErrors {
code
message
}
}
}
`;
Expected behavior
The types should be generated
Actual behavior
What actually happens?
Fails with errors :
`Generate to ./src/platform/shopifyv2/storefront-types/storefront.generated.ts
✔ Load GraphQL schemas
✔ Load GraphQL documents
✖ GraphQL Document Validation failed with 4 errors;
Error 0: Cannot query field "delivery" on type "Cart".
at /src/platform/shopifyv2/commons/mutations/create-cart.ts:23:11
Error 1: Unknown type "CartDeliveryAddress". Did you mean "DeliveryAddress", "CartDeliveryGroup", "CartDeliveryOption", "CartDeliveryGroupEdge", or …
at /shopifyv2/commons/mutations/create-cart.ts:26:23
Error 2: Cannot query field "discountApplication" on type "CartCodeDiscountAllocation".
at /shopifyv2/commons/mutations/create-cart.ts:44:8
Error 3: Cannot query field "discountApplication" on type "CartCodeDiscountAllocation".
at /shopifyv2/commons/mutations/create-cart.ts:98:11`
Steps to reproduce the problem
Debug logs
// Paste any relevant logs here
The text was updated successfully, but these errors were encountered:
I believe this was because of an underlying error with the API that returned the schema. This should now be resolved. Please create a new issue if you continue to have similar problems.
Issue summary
Before opening this issue, I have:
@shopify/*
package and version:{ logger: { level: LogSeverity.Debug } }
in my configuration, when applicableHi ! I'm getting some issues generating my types. Note than the request itself works perfectly, it's just about types generations. If i comment the delivery / discountApplication parts, it works. Could anyone help ? thanks a lot !
`Generate to ./src/platform/shopifyv2/storefront-types/storefront.generated.ts
here is my conf :
and here is my mutation query cart :
Expected behavior
The types should be generated
Actual behavior
What actually happens?
Fails with errors :
`Generate to ./src/platform/shopifyv2/storefront-types/storefront.generated.ts
Steps to reproduce the problem
Debug logs
The text was updated successfully, but these errors were encountered: