Skip to content

Commit

Permalink
chore: Improve codegen config for Mollie types (#3089)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonntag-philipp authored Sep 27, 2024
1 parent 8434111 commit eda6f20
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 207 deletions.
193 changes: 0 additions & 193 deletions packages/core/e2e/graphql/generated-e2e-admin-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6422,28 +6422,6 @@ export type AssignAssetsToChannelMutation = {
}>;
};

export type CanCreateCustomerMutationVariables = Exact<{
input: CreateCustomerInput;
}>;

export type CanCreateCustomerMutation = { createCustomer: { id: string } | {} };

export type GetCustomerCountQueryVariables = Exact<{ [key: string]: never }>;

export type GetCustomerCountQuery = { customers: { totalItems: number } };

export type DeepFieldResolutionTestQueryQueryVariables = Exact<{ [key: string]: never }>;

export type DeepFieldResolutionTestQueryQuery = {
product?: {
variants: Array<{
taxRateApplied: {
customerGroup?: { customers: { items: Array<{ id: string; emailAddress: string }> } } | null;
};
}>;
} | null;
};

export type AuthenticateMutationVariables = Exact<{
input: AuthenticationInput;
}>;
Expand Down Expand Up @@ -15414,177 +15392,6 @@ export const AssignAssetsToChannelDocument = {
},
],
} as unknown as DocumentNode<AssignAssetsToChannelMutation, AssignAssetsToChannelMutationVariables>;
export const CanCreateCustomerDocument = {
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'mutation',
name: { kind: 'Name', value: 'CanCreateCustomer' },
variableDefinitions: [
{
kind: 'VariableDefinition',
variable: { kind: 'Variable', name: { kind: 'Name', value: 'input' } },
type: {
kind: 'NonNullType',
type: { kind: 'NamedType', name: { kind: 'Name', value: 'CreateCustomerInput' } },
},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'createCustomer' },
arguments: [
{
kind: 'Argument',
name: { kind: 'Name', value: 'input' },
value: { kind: 'Variable', name: { kind: 'Name', value: 'input' } },
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'InlineFragment',
typeCondition: {
kind: 'NamedType',
name: { kind: 'Name', value: 'Customer' },
},
selectionSet: {
kind: 'SelectionSet',
selections: [{ kind: 'Field', name: { kind: 'Name', value: 'id' } }],
},
},
],
},
},
],
},
},
],
} as unknown as DocumentNode<CanCreateCustomerMutation, CanCreateCustomerMutationVariables>;
export const GetCustomerCountDocument = {
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'query',
name: { kind: 'Name', value: 'GetCustomerCount' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'customers' },
selectionSet: {
kind: 'SelectionSet',
selections: [{ kind: 'Field', name: { kind: 'Name', value: 'totalItems' } }],
},
},
],
},
},
],
} as unknown as DocumentNode<GetCustomerCountQuery, GetCustomerCountQueryVariables>;
export const DeepFieldResolutionTestQueryDocument = {
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'query',
name: { kind: 'Name', value: 'DeepFieldResolutionTestQuery' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'product' },
arguments: [
{
kind: 'Argument',
name: { kind: 'Name', value: 'id' },
value: { kind: 'StringValue', value: 'T_1', block: false },
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'variants' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'taxRateApplied' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'customerGroup' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {
kind: 'Name',
value: 'customers',
},
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {
kind: 'Name',
value: 'items',
},
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {
kind: 'Name',
value: 'id',
},
},
{
kind: 'Field',
name: {
kind: 'Name',
value: 'emailAddress',
},
},
],
},
},
],
},
},
],
},
},
],
},
},
],
},
},
],
},
},
],
},
},
],
} as unknown as DocumentNode<DeepFieldResolutionTestQueryQuery, DeepFieldResolutionTestQueryQueryVariables>;
export const AuthenticateDocument = {
kind: 'Document',
definitions: [
Expand Down
42 changes: 40 additions & 2 deletions packages/payments-plugin/e2e/graphql/generated-admin-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ export type Scalars = {
Boolean: { input: boolean; output: boolean };
Int: { input: number; output: number };
Float: { input: number; output: number };
/** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */
DateTime: { input: any; output: any };
/** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */
JSON: { input: any; output: any };
/** The `Money` scalar type represents monetary values and supports signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point). */
Money: { input: number; output: number };
/** The `Upload` scalar type represents a file upload. */
Upload: { input: any; output: any };
};

Expand Down Expand Up @@ -1617,7 +1621,6 @@ export enum ErrorCode {
MANUAL_PAYMENT_STATE_ERROR = 'MANUAL_PAYMENT_STATE_ERROR',
MIME_TYPE_ERROR = 'MIME_TYPE_ERROR',
MISSING_CONDITIONS_ERROR = 'MISSING_CONDITIONS_ERROR',
MOLLIE_PAYMENT_INTENT_ERROR = 'MOLLIE_PAYMENT_INTENT_ERROR',
MULTIPLE_ORDER_ERROR = 'MULTIPLE_ORDER_ERROR',
NATIVE_AUTH_STRATEGY_ERROR = 'NATIVE_AUTH_STRATEGY_ERROR',
NEGATIVE_QUANTITY_ERROR = 'NEGATIVE_QUANTITY_ERROR',
Expand Down Expand Up @@ -2601,6 +2604,11 @@ export type ModifyOrderResult =
| PaymentMethodMissingError
| RefundPaymentIdMissingError;

export type MollieAmount = {
currency?: Maybe<Scalars['String']['output']>;
value?: Maybe<Scalars['String']['output']>;
};

export type MolliePaymentIntent = {
url: Scalars['String']['output'];
};
Expand Down Expand Up @@ -2636,6 +2644,26 @@ export type MolliePaymentIntentInput = {

export type MolliePaymentIntentResult = MolliePaymentIntent | MolliePaymentIntentError;

export type MolliePaymentMethod = {
code: Scalars['String']['output'];
description?: Maybe<Scalars['String']['output']>;
id: Scalars['ID']['output'];
image?: Maybe<MolliePaymentMethodImages>;
maximumAmount?: Maybe<MollieAmount>;
minimumAmount?: Maybe<MollieAmount>;
status?: Maybe<Scalars['String']['output']>;
};

export type MolliePaymentMethodImages = {
size1x?: Maybe<Scalars['String']['output']>;
size2x?: Maybe<Scalars['String']['output']>;
svg?: Maybe<Scalars['String']['output']>;
};

export type MolliePaymentMethodsInput = {
paymentMethodCode: Scalars['String']['input'];
};

export type MoveCollectionInput = {
collectionId: Scalars['ID']['input'];
index: Scalars['Int']['input'];
Expand Down Expand Up @@ -2843,7 +2871,12 @@ export type Mutation = {
duplicateEntity: DuplicateEntityResult;
flushBufferedJobs: Success;
importProducts?: Maybe<ImportInfo>;
/** Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` */
/**
* Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})
*
* The `rememberMe` option applies when using cookie-based sessions, and if `true` it will set the maxAge of the session cookie
* to 1 year.
*/
login: NativeAuthenticationResult;
logout: Success;
/**
Expand Down Expand Up @@ -4811,6 +4844,7 @@ export type Query = {
me?: Maybe<CurrentUser>;
/** Get metrics for the given interval and metric types. */
metricSummary: Array<MetricSummary>;
molliePaymentMethods: Array<MolliePaymentMethod>;
order?: Maybe<Order>;
orders: OrderList;
paymentMethod?: Maybe<PaymentMethod>;
Expand Down Expand Up @@ -4952,6 +4986,10 @@ export type QueryMetricSummaryArgs = {
input?: InputMaybe<MetricSummaryInput>;
};

export type QueryMolliePaymentMethodsArgs = {
input: MolliePaymentMethodsInput;
};

export type QueryOrderArgs = {
id: Scalars['ID']['input'];
};
Expand Down
12 changes: 10 additions & 2 deletions packages/payments-plugin/e2e/graphql/generated-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ export type Scalars = {
Boolean: { input: boolean; output: boolean };
Int: { input: number; output: number };
Float: { input: number; output: number };
/** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */
DateTime: { input: any; output: any };
/** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */
JSON: { input: any; output: any };
/** The `Money` scalar type represents monetary values and supports signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point). */
Money: { input: number; output: number };
/** The `Upload` scalar type represents a file upload. */
Upload: { input: any; output: any };
};

Expand Down Expand Up @@ -895,7 +899,6 @@ export enum ErrorCode {
INSUFFICIENT_STOCK_ERROR = 'INSUFFICIENT_STOCK_ERROR',
INVALID_CREDENTIALS_ERROR = 'INVALID_CREDENTIALS_ERROR',
MISSING_PASSWORD_ERROR = 'MISSING_PASSWORD_ERROR',
MOLLIE_PAYMENT_INTENT_ERROR = 'MOLLIE_PAYMENT_INTENT_ERROR',
NATIVE_AUTH_STRATEGY_ERROR = 'NATIVE_AUTH_STRATEGY_ERROR',
NEGATIVE_QUANTITY_ERROR = 'NEGATIVE_QUANTITY_ERROR',
NOT_VERIFIED_ERROR = 'NOT_VERIFIED_ERROR',
Expand Down Expand Up @@ -1706,7 +1709,12 @@ export type Mutation = {
createMolliePaymentIntent: MolliePaymentIntentResult;
/** Delete an existing Address */
deleteCustomerAddress: Success;
/** Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` */
/**
* Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})
*
* The `rememberMe` option applies when using cookie-based sessions, and if `true` it will set the maxAge of the session cookie
* to 1 year.
*/
login: NativeAuthenticationResult;
/** End the current authenticated session */
logout: Success;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ export type Scalars = {
Boolean: { input: boolean; output: boolean };
Int: { input: number; output: number };
Float: { input: number; output: number };
/** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */
DateTime: { input: any; output: any };
/** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */
JSON: { input: any; output: any };
/** The `Money` scalar type represents monetary values and supports signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point). */
Money: { input: number; output: number };
/** The `Upload` scalar type represents a file upload. */
Upload: { input: any; output: any };
};

Expand Down Expand Up @@ -926,7 +930,6 @@ export enum ErrorCode {
INSUFFICIENT_STOCK_ERROR = 'INSUFFICIENT_STOCK_ERROR',
INVALID_CREDENTIALS_ERROR = 'INVALID_CREDENTIALS_ERROR',
MISSING_PASSWORD_ERROR = 'MISSING_PASSWORD_ERROR',
MOLLIE_PAYMENT_INTENT_ERROR = 'MOLLIE_PAYMENT_INTENT_ERROR',
NATIVE_AUTH_STRATEGY_ERROR = 'NATIVE_AUTH_STRATEGY_ERROR',
NEGATIVE_QUANTITY_ERROR = 'NEGATIVE_QUANTITY_ERROR',
NOT_VERIFIED_ERROR = 'NOT_VERIFIED_ERROR',
Expand Down Expand Up @@ -1767,7 +1770,12 @@ export type Mutation = {
createMolliePaymentIntent: MolliePaymentIntentResult;
/** Delete an existing Address */
deleteCustomerAddress: Success;
/** Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` */
/**
* Authenticates the user using the native authentication strategy. This mutation is an alias for authenticate({ native: { ... }})
*
* The `rememberMe` option applies when using cookie-based sessions, and if `true` it will set the maxAge of the session cookie
* to 1 year.
*/
login: NativeAuthenticationResult;
/** End the current authenticated session */
logout: Success;
Expand Down
2 changes: 1 addition & 1 deletion schema-admin.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion schema-shop.json

Large diffs are not rendered by default.

Loading

0 comments on commit eda6f20

Please sign in to comment.