Merge pull request #15827 from mozilla/FXA-8276_query

feat(contentful): Add query to get upgrade/eligibility-related content for a Plan ID
This commit is contained in:
Lisa Chan 2023-09-26 14:10:42 -04:00 коммит произвёл GitHub
Родитель 82829b261a e2bdb036db
Коммит 66f27b9a8b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 379 добавлений и 0 удалений

8
libs/shared/contentful/src/__generated__/gql.ts сгенерированный
Просмотреть файл

@ -15,6 +15,8 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
const documents = {
'\n query CapabilityServiceByPriceIds(\n $skip: Int!\n $limit: Int!\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n locale: $locale\n where: { stripePlanChoices_contains_some: $stripePlanIds }\n ) {\n items {\n stripePlanChoices\n offering {\n capabilitiesCollection(skip: $skip, limit: $limit) {\n items {\n slug\n servicesCollection(skip: $skip, limit: $limit) {\n items {\n oauthClientId\n }\n }\n }\n }\n }\n }\n }\n }\n':
types.CapabilityServiceByPriceIdsDocument,
'\n query EligibilityContentByPlanIds(\n $skip: Int!\n $limit: Int!\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n locale: $locale\n where: { stripePlanChoices_contains_some: $stripePlanIds }\n ) {\n items {\n stripePlanChoices\n offering {\n stripeProductId\n countries\n linkedFrom {\n subGroupCollection(skip: $skip, limit: $limit) {\n items {\n groupName\n offeringCollection(skip: $skip, limit: $limit) {\n items {\n stripeProductId\n countries\n }\n }\n }\n }\n }\n }\n }\n }\n }\n':
types.EligibilityContentByPlanIdsDocument,
'\n query Offering($id: String!, $locale: String!) {\n offering(id: $id, locale: $locale) {\n stripeProductId\n countries\n defaultPurchase {\n purchaseDetails {\n productName\n details\n subtitle\n webIcon\n }\n }\n }\n }\n':
types.OfferingDocument,
'\n query PurchaseWithDetails($id: String!, $locale: String!) {\n purchase(id: $id, locale: $locale) {\n internalName\n description\n purchaseDetails {\n productName\n details\n webIcon\n }\n }\n }\n':
@ -45,6 +47,12 @@ export function graphql(source: string): unknown;
export function graphql(
source: '\n query CapabilityServiceByPriceIds(\n $skip: Int!\n $limit: Int!\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n locale: $locale\n where: { stripePlanChoices_contains_some: $stripePlanIds }\n ) {\n items {\n stripePlanChoices\n offering {\n capabilitiesCollection(skip: $skip, limit: $limit) {\n items {\n slug\n servicesCollection(skip: $skip, limit: $limit) {\n items {\n oauthClientId\n }\n }\n }\n }\n }\n }\n }\n }\n'
): (typeof documents)['\n query CapabilityServiceByPriceIds(\n $skip: Int!\n $limit: Int!\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n locale: $locale\n where: { stripePlanChoices_contains_some: $stripePlanIds }\n ) {\n items {\n stripePlanChoices\n offering {\n capabilitiesCollection(skip: $skip, limit: $limit) {\n items {\n slug\n servicesCollection(skip: $skip, limit: $limit) {\n items {\n oauthClientId\n }\n }\n }\n }\n }\n }\n }\n }\n'];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(
source: '\n query EligibilityContentByPlanIds(\n $skip: Int!\n $limit: Int!\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n locale: $locale\n where: { stripePlanChoices_contains_some: $stripePlanIds }\n ) {\n items {\n stripePlanChoices\n offering {\n stripeProductId\n countries\n linkedFrom {\n subGroupCollection(skip: $skip, limit: $limit) {\n items {\n groupName\n offeringCollection(skip: $skip, limit: $limit) {\n items {\n stripeProductId\n countries\n }\n }\n }\n }\n }\n }\n }\n }\n }\n'
): (typeof documents)['\n query EligibilityContentByPlanIds(\n $skip: Int!\n $limit: Int!\n $locale: String!\n $stripePlanIds: [String]!\n ) {\n purchaseCollection(\n skip: $skip\n limit: $limit\n locale: $locale\n where: { stripePlanChoices_contains_some: $stripePlanIds }\n ) {\n items {\n stripePlanChoices\n offering {\n stripeProductId\n countries\n linkedFrom {\n subGroupCollection(skip: $skip, limit: $limit) {\n items {\n groupName\n offeringCollection(skip: $skip, limit: $limit) {\n items {\n stripeProductId\n countries\n }\n }\n }\n }\n }\n }\n }\n }\n }\n'];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/

329
libs/shared/contentful/src/__generated__/graphql.ts сгенерированный
Просмотреть файл

@ -2697,6 +2697,49 @@ export type CapabilityServiceByPriceIdsQuery = {
} | null;
};
export type EligibilityContentByPlanIdsQueryVariables = Exact<{
skip: Scalars['Int']['input'];
limit: Scalars['Int']['input'];
locale: Scalars['String']['input'];
stripePlanIds:
| Array<InputMaybe<Scalars['String']['input']>>
| InputMaybe<Scalars['String']['input']>;
}>;
export type EligibilityContentByPlanIdsQuery = {
__typename?: 'Query';
purchaseCollection?: {
__typename?: 'PurchaseCollection';
items: Array<{
__typename?: 'Purchase';
stripePlanChoices?: Array<string | null> | null;
offering?: {
__typename?: 'Offering';
stripeProductId?: string | null;
countries?: Array<string | null> | null;
linkedFrom?: {
__typename?: 'OfferingLinkingCollections';
subGroupCollection?: {
__typename?: 'SubGroupCollection';
items: Array<{
__typename?: 'SubGroup';
groupName?: string | null;
offeringCollection?: {
__typename?: 'SubGroupOfferingCollection';
items: Array<{
__typename?: 'Offering';
stripeProductId?: string | null;
countries?: Array<string | null> | null;
} | null>;
} | null;
} | null>;
} | null;
} | null;
} | null;
} | null>;
} | null;
};
export type OfferingQueryVariables = Exact<{
id: Scalars['String']['input'];
locale: Scalars['String']['input'];
@ -3058,6 +3101,292 @@ export const CapabilityServiceByPriceIdsDocument = {
CapabilityServiceByPriceIdsQuery,
CapabilityServiceByPriceIdsQueryVariables
>;
export const EligibilityContentByPlanIdsDocument = {
kind: 'Document',
definitions: [
{
kind: 'OperationDefinition',
operation: 'query',
name: { kind: 'Name', value: 'EligibilityContentByPlanIds' },
variableDefinitions: [
{
kind: 'VariableDefinition',
variable: { kind: 'Variable', name: { kind: 'Name', value: 'skip' } },
type: {
kind: 'NonNullType',
type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } },
},
},
{
kind: 'VariableDefinition',
variable: {
kind: 'Variable',
name: { kind: 'Name', value: 'limit' },
},
type: {
kind: 'NonNullType',
type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } },
},
},
{
kind: 'VariableDefinition',
variable: {
kind: 'Variable',
name: { kind: 'Name', value: 'locale' },
},
type: {
kind: 'NonNullType',
type: {
kind: 'NamedType',
name: { kind: 'Name', value: 'String' },
},
},
},
{
kind: 'VariableDefinition',
variable: {
kind: 'Variable',
name: { kind: 'Name', value: 'stripePlanIds' },
},
type: {
kind: 'NonNullType',
type: {
kind: 'ListType',
type: {
kind: 'NamedType',
name: { kind: 'Name', value: 'String' },
},
},
},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'purchaseCollection' },
arguments: [
{
kind: 'Argument',
name: { kind: 'Name', value: 'skip' },
value: {
kind: 'Variable',
name: { kind: 'Name', value: 'skip' },
},
},
{
kind: 'Argument',
name: { kind: 'Name', value: 'limit' },
value: {
kind: 'Variable',
name: { kind: 'Name', value: 'limit' },
},
},
{
kind: 'Argument',
name: { kind: 'Name', value: 'locale' },
value: {
kind: 'Variable',
name: { kind: 'Name', value: 'locale' },
},
},
{
kind: 'Argument',
name: { kind: 'Name', value: 'where' },
value: {
kind: 'ObjectValue',
fields: [
{
kind: 'ObjectField',
name: {
kind: 'Name',
value: 'stripePlanChoices_contains_some',
},
value: {
kind: 'Variable',
name: { kind: 'Name', value: 'stripePlanIds' },
},
},
],
},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'items' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'stripePlanChoices' },
},
{
kind: 'Field',
name: { kind: 'Name', value: 'offering' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: { kind: 'Name', value: 'stripeProductId' },
},
{
kind: 'Field',
name: { kind: 'Name', value: 'countries' },
},
{
kind: 'Field',
name: { kind: 'Name', value: 'linkedFrom' },
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {
kind: 'Name',
value: 'subGroupCollection',
},
arguments: [
{
kind: 'Argument',
name: { kind: 'Name', value: 'skip' },
value: {
kind: 'Variable',
name: { kind: 'Name', value: 'skip' },
},
},
{
kind: 'Argument',
name: { kind: 'Name', value: 'limit' },
value: {
kind: 'Variable',
name: {
kind: 'Name',
value: 'limit',
},
},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {
kind: 'Name',
value: 'items',
},
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {
kind: 'Name',
value: 'groupName',
},
},
{
kind: 'Field',
name: {
kind: 'Name',
value: 'offeringCollection',
},
arguments: [
{
kind: 'Argument',
name: {
kind: 'Name',
value: 'skip',
},
value: {
kind: 'Variable',
name: {
kind: 'Name',
value: 'skip',
},
},
},
{
kind: 'Argument',
name: {
kind: 'Name',
value: 'limit',
},
value: {
kind: 'Variable',
name: {
kind: 'Name',
value: 'limit',
},
},
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {
kind: 'Name',
value: 'items',
},
selectionSet: {
kind: 'SelectionSet',
selections: [
{
kind: 'Field',
name: {
kind: 'Name',
value:
'stripeProductId',
},
},
{
kind: 'Field',
name: {
kind: 'Name',
value:
'countries',
},
},
],
},
},
],
},
},
],
},
},
],
},
},
],
},
},
],
},
},
],
},
},
],
},
},
],
},
},
],
} as unknown as DocumentNode<
EligibilityContentByPlanIdsQuery,
EligibilityContentByPlanIdsQueryVariables
>;
export const OfferingDocument = {
kind: 'Document',
definitions: [

Просмотреть файл

@ -0,0 +1,42 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import { graphql } from '../../__generated__/gql';
export const eligibilityContentByPlanIdsQuery = graphql(`
query EligibilityContentByPlanIds(
$skip: Int!
$limit: Int!
$locale: String!
$stripePlanIds: [String]!
) {
purchaseCollection(
skip: $skip
limit: $limit
locale: $locale
where: { stripePlanChoices_contains_some: $stripePlanIds }
) {
items {
stripePlanChoices
offering {
stripeProductId
countries
linkedFrom {
subGroupCollection(skip: $skip, limit: $limit) {
items {
groupName
offeringCollection(skip: $skip, limit: $limit) {
items {
stripeProductId
countries
}
}
}
}
}
}
}
}
}
`);