Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Schema to 2024-10 Release #1244

Merged
merged 5 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Ruby
uses: ruby/setup-ruby@v1
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
git push --set-upstream --force origin $BRANCH_NAME

- name: Create pull request
uses: actions/github-script@0.9.0
uses: actions/github-script@v7
with:
script: |
const api_version = process.env.API_VERSION
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Ruby
uses: ruby/setup-ruby@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Get SDK version
id: sdk-version
Expand All @@ -24,7 +24,7 @@ jobs:
echo "API_VERSION=$API_VERSION" >> $GITHUB_ENV

- name: Create a draft release
uses: actions/github-script@0.9.0
uses: actions/github-script@v7
with:
script: |
const api_version = process.env.API_VERSION
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Ruby
uses: ruby/setup-ruby@v1
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.0
3.3.4
144 changes: 144 additions & 0 deletions Buy.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Buy/Generated/Storefront.Schema.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

extension Storefront {
enum Schema {
static let version = "2024-07"
static let version = "2024-10"
}
}
18 changes: 14 additions & 4 deletions Buy/Generated/Storefront/Article.swift
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,13 @@ extension Storefront {
return self
}

/// A URL parameters to be added to a page URL when it is linked from a GraphQL
/// result. This allows for tracking the origin of the traffic.
/// URL parameters to be added to a page URL to track the origin of on-site
/// search traffic for [analytics
/// reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/default-reports/behaviour-reports).
/// Returns a result when accessed through the
/// [search](https://shopify.dev/docs/api/storefront/current/queries/search) or
/// [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch)
/// queries, otherwise returns null.
@discardableResult
open func trackingParameters(alias: String? = nil) -> ArticleQuery {
addField(field: "trackingParameters", aliasSuffix: alias)
Expand Down Expand Up @@ -603,8 +608,13 @@ extension Storefront {
return field(field: "title", aliasSuffix: alias) as! String
}

/// A URL parameters to be added to a page URL when it is linked from a GraphQL
/// result. This allows for tracking the origin of the traffic.
/// URL parameters to be added to a page URL to track the origin of on-site
/// search traffic for [analytics
/// reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/default-reports/behaviour-reports).
/// Returns a result when accessed through the
/// [search](https://shopify.dev/docs/api/storefront/current/queries/search) or
/// [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch)
/// queries, otherwise returns null.
open var trackingParameters: String? {
return internalGetTrackingParameters()
}
Expand Down
14 changes: 8 additions & 6 deletions Buy/Generated/Storefront/Attribute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,28 @@
import Foundation

extension Storefront {
/// Represents a generic custom attribute.
/// Represents a generic custom attribute, such as whether an order is a
/// customer's first.
open class AttributeQuery: GraphQL.AbstractQuery, GraphQLQuery {
public typealias Response = Attribute

/// Key or name of the attribute.
/// The key or name of the attribute. For example, `"customersFirstOrder"`.
@discardableResult
open func key(alias: String? = nil) -> AttributeQuery {
addField(field: "key", aliasSuffix: alias)
return self
}

/// Value of the attribute.
/// The value of the attribute. For example, `"true"`.
@discardableResult
open func value(alias: String? = nil) -> AttributeQuery {
addField(field: "value", aliasSuffix: alias)
return self
}
}

/// Represents a generic custom attribute.
/// Represents a generic custom attribute, such as whether an order is a
/// customer's first.
open class Attribute: GraphQL.AbstractResponse, GraphQLObject {
public typealias Query = AttributeQuery

Expand All @@ -71,7 +73,7 @@ extension Storefront {
}
}

/// Key or name of the attribute.
/// The key or name of the attribute. For example, `"customersFirstOrder"`.
open var key: String {
return internalGetKey()
}
Expand All @@ -80,7 +82,7 @@ extension Storefront {
return field(field: "key", aliasSuffix: alias) as! String
}

/// Value of the attribute.
/// The value of the attribute. For example, `"true"`.
open var value: String? {
return internalGetValue()
}
Expand Down
31 changes: 31 additions & 0 deletions Buy/Generated/Storefront/CartAttributesUpdatePayload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ extension Storefront {
addField(field: "userErrors", aliasSuffix: alias, subfields: subquery)
return self
}

/// A list of warnings that occurred during the mutation.
@discardableResult
open func warnings(alias: String? = nil, _ subfields: (CartWarningQuery) -> Void) -> CartAttributesUpdatePayloadQuery {
let subquery = CartWarningQuery()
subfields(subquery)

addField(field: "warnings", aliasSuffix: alias, subfields: subquery)
return self
}
}

/// Return type for `cartAttributesUpdate` mutation.
Expand All @@ -72,6 +82,12 @@ extension Storefront {
}
return try value.map { return try CartUserError(fields: $0) }

case "warnings":
guard let value = value as? [[String: Any]] else {
throw SchemaViolationError(type: CartAttributesUpdatePayload.self, field: fieldName, value: fieldValue)
}
return try value.map { return try CartWarning(fields: $0) }

default:
throw SchemaViolationError(type: CartAttributesUpdatePayload.self, field: fieldName, value: fieldValue)
}
Expand All @@ -95,6 +111,15 @@ extension Storefront {
return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.CartUserError]
}

/// A list of warnings that occurred during the mutation.
open var warnings: [Storefront.CartWarning] {
return internalGetWarnings()
}

func internalGetWarnings(alias: String? = nil) -> [Storefront.CartWarning] {
return field(field: "warnings", aliasSuffix: alias) as! [Storefront.CartWarning]
}

internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] {
var response: [GraphQL.AbstractResponse] = []
objectMap.keys.forEach {
Expand All @@ -111,6 +136,12 @@ extension Storefront {
response.append(contentsOf: $0.childResponseObjectMap())
}

case "warnings":
internalGetWarnings().forEach {
response.append($0)
response.append(contentsOf: $0.childResponseObjectMap())
}

default:
break
}
Expand Down
31 changes: 31 additions & 0 deletions Buy/Generated/Storefront/CartBillingAddressUpdatePayload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ extension Storefront {
addField(field: "userErrors", aliasSuffix: alias, subfields: subquery)
return self
}

/// A list of warnings that occurred during the mutation.
@discardableResult
open func warnings(alias: String? = nil, _ subfields: (CartWarningQuery) -> Void) -> CartBillingAddressUpdatePayloadQuery {
let subquery = CartWarningQuery()
subfields(subquery)

addField(field: "warnings", aliasSuffix: alias, subfields: subquery)
return self
}
}

/// Return type for `cartBillingAddressUpdate` mutation.
Expand All @@ -72,6 +82,12 @@ extension Storefront {
}
return try value.map { return try CartUserError(fields: $0) }

case "warnings":
guard let value = value as? [[String: Any]] else {
throw SchemaViolationError(type: CartBillingAddressUpdatePayload.self, field: fieldName, value: fieldValue)
}
return try value.map { return try CartWarning(fields: $0) }

default:
throw SchemaViolationError(type: CartBillingAddressUpdatePayload.self, field: fieldName, value: fieldValue)
}
Expand All @@ -95,6 +111,15 @@ extension Storefront {
return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.CartUserError]
}

/// A list of warnings that occurred during the mutation.
open var warnings: [Storefront.CartWarning] {
return internalGetWarnings()
}

func internalGetWarnings(alias: String? = nil) -> [Storefront.CartWarning] {
return field(field: "warnings", aliasSuffix: alias) as! [Storefront.CartWarning]
}

internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] {
var response: [GraphQL.AbstractResponse] = []
objectMap.keys.forEach {
Expand All @@ -111,6 +136,12 @@ extension Storefront {
response.append(contentsOf: $0.childResponseObjectMap())
}

case "warnings":
internalGetWarnings().forEach {
response.append($0)
response.append(contentsOf: $0.childResponseObjectMap())
}

default:
break
}
Expand Down
31 changes: 31 additions & 0 deletions Buy/Generated/Storefront/CartBuyerIdentityUpdatePayload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ extension Storefront {
addField(field: "userErrors", aliasSuffix: alias, subfields: subquery)
return self
}

/// A list of warnings that occurred during the mutation.
@discardableResult
open func warnings(alias: String? = nil, _ subfields: (CartWarningQuery) -> Void) -> CartBuyerIdentityUpdatePayloadQuery {
let subquery = CartWarningQuery()
subfields(subquery)

addField(field: "warnings", aliasSuffix: alias, subfields: subquery)
return self
}
}

/// Return type for `cartBuyerIdentityUpdate` mutation.
Expand All @@ -72,6 +82,12 @@ extension Storefront {
}
return try value.map { return try CartUserError(fields: $0) }

case "warnings":
guard let value = value as? [[String: Any]] else {
throw SchemaViolationError(type: CartBuyerIdentityUpdatePayload.self, field: fieldName, value: fieldValue)
}
return try value.map { return try CartWarning(fields: $0) }

default:
throw SchemaViolationError(type: CartBuyerIdentityUpdatePayload.self, field: fieldName, value: fieldValue)
}
Expand All @@ -95,6 +111,15 @@ extension Storefront {
return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.CartUserError]
}

/// A list of warnings that occurred during the mutation.
open var warnings: [Storefront.CartWarning] {
return internalGetWarnings()
}

func internalGetWarnings(alias: String? = nil) -> [Storefront.CartWarning] {
return field(field: "warnings", aliasSuffix: alias) as! [Storefront.CartWarning]
}

internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] {
var response: [GraphQL.AbstractResponse] = []
objectMap.keys.forEach {
Expand All @@ -111,6 +136,12 @@ extension Storefront {
response.append(contentsOf: $0.childResponseObjectMap())
}

case "warnings":
internalGetWarnings().forEach {
response.append($0)
response.append(contentsOf: $0.childResponseObjectMap())
}

default:
break
}
Expand Down
31 changes: 31 additions & 0 deletions Buy/Generated/Storefront/CartCreatePayload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ extension Storefront {
addField(field: "userErrors", aliasSuffix: alias, subfields: subquery)
return self
}

/// A list of warnings that occurred during the mutation.
@discardableResult
open func warnings(alias: String? = nil, _ subfields: (CartWarningQuery) -> Void) -> CartCreatePayloadQuery {
let subquery = CartWarningQuery()
subfields(subquery)

addField(field: "warnings", aliasSuffix: alias, subfields: subquery)
return self
}
}

/// Return type for `cartCreate` mutation.
Expand All @@ -72,6 +82,12 @@ extension Storefront {
}
return try value.map { return try CartUserError(fields: $0) }

case "warnings":
guard let value = value as? [[String: Any]] else {
throw SchemaViolationError(type: CartCreatePayload.self, field: fieldName, value: fieldValue)
}
return try value.map { return try CartWarning(fields: $0) }

default:
throw SchemaViolationError(type: CartCreatePayload.self, field: fieldName, value: fieldValue)
}
Expand All @@ -95,6 +111,15 @@ extension Storefront {
return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.CartUserError]
}

/// A list of warnings that occurred during the mutation.
open var warnings: [Storefront.CartWarning] {
return internalGetWarnings()
}

func internalGetWarnings(alias: String? = nil) -> [Storefront.CartWarning] {
return field(field: "warnings", aliasSuffix: alias) as! [Storefront.CartWarning]
}

internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] {
var response: [GraphQL.AbstractResponse] = []
objectMap.keys.forEach {
Expand All @@ -111,6 +136,12 @@ extension Storefront {
response.append(contentsOf: $0.childResponseObjectMap())
}

case "warnings":
internalGetWarnings().forEach {
response.append($0)
response.append(contentsOf: $0.childResponseObjectMap())
}

default:
break
}
Expand Down
Loading
Loading