diff --git a/starters/nextjs/firebase-ecommerce/.gitignore b/starters/nextjs/firebase-ecommerce/.gitignore index a8219e06..0422c0d2 100644 --- a/starters/nextjs/firebase-ecommerce/.gitignore +++ b/starters/nextjs/firebase-ecommerce/.gitignore @@ -40,4 +40,9 @@ vsce-debug.log* # Firebase firebase-debug.log* firebase-debug.* -.firebase \ No newline at end of file +.firebase +.firebaserc + +# dataconnect +dataconnect-generated/ +dataconnect/.dataconnect/ diff --git a/starters/nextjs/firebase-ecommerce/README.md b/starters/nextjs/firebase-ecommerce/README.md index a7cce485..c0666585 100644 --- a/starters/nextjs/firebase-ecommerce/README.md +++ b/starters/nextjs/firebase-ecommerce/README.md @@ -28,8 +28,8 @@ The application provides a quick and easy to use shopping experience with featur 1. Create a new Firebase project in the [Firebase Console](https://console.firebase.google.com). 2. Enable **Email/Password Authentication**. -3. Add Firebase app secrets to `.env.local`. -4. Include Firebase app secrets in **App Hosting**. +3. Replace the relevant commented-out environment variables in `apphosting.yaml` + with your firebase config. #### Firebase Data Connect @@ -37,7 +37,9 @@ The application provides a quick and easy to use shopping experience with featur 2. Create a new Data Connect instance and service. 3. Set up billing for the Firebase project. 4. Switch to the Blaze plan. -5. Define the required schema, queries, and mutations. +5. Modify `dataconnect/dataconnect.yaml` to specify `serviceId`, `location`, + `schema.datasource.postgresql.database` and + `schema.datasource.postgressql.cloudSql.instanceId` 6. Deploy the schema, queries, and mutations to production. #### Firebase Storage @@ -48,13 +50,18 @@ The application provides a quick and easy to use shopping experience with featur #### Firebase App Hosting 1. Connect the Firebase app to your GitHub repository. -2. Create a new backend for the application. -3. Deploy secrets to app hosting using the Firebase CLI. -4. Deploy the application to Firebase Hosting. +2. Create a new backend for the application, but do not deploy yet. + We need to set up environment variables first for the app to work. ### Stripe Setup 1. Create a new Stripe account. +2. Follow the instructions in apphosting.yaml to create the + public and private keys for your stripe application. +3. Create a webhook that listen to "Events on your account" at + /api/stripe/webhook that receives at least + the following events: `payment_intent.succeeded`, `payment_intent.failed`, + `charge.succeeded`, `charge.updated`. 2. Add API keys (Publishable and Secret) to `.env.local`. 3. Set up a webhook endpoint in the Firebase project. 4. Add the webhook secret to `.env.local`. @@ -63,12 +70,18 @@ The application provides a quick and easy to use shopping experience with featur ## Environment Variables -The following environment variables must be configured in `.env.local`: +The following environment variables must be configured in `apphosting.yaml` +(there are comments for where to find these values) -- **Firebase Secrets**: `NEXT_PUBLIC_FIREBASE_API_KEY`, `NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN`, `NEXT_PUBLIC_FIREBASE_PROJECT_ID`, `NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET`, `NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID`, `NEXT_PUBLIC_FIREBASE_APP_ID`. -- **Stripe Secrets**: `NEXT_PUBLIC_STRIPE_PUB_KEY`, `STRIPE_SECRET_KEY`, `STRIPE_WEBHOOK_SECRET` +- **Firebase Config**: `NEXT_PUBLIC_FIREBASE_API_KEY`, `NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN`, `NEXT_PUBLIC_FIREBASE_PROJECT_ID`, `NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET`, `NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID`, `NEXT_PUBLIC_FIREBASE_APP_ID`. +- **Stripe Config**: `NEXT_PUBLIC_STRIPE_PUB_KEY`, `STRIPE_SECRET_KEY`, `STRIPE_WEBHOOK_SECRET` - **Google/Gemini API Key**: `GOOGLE_API_KEY` +## Deploy +Once you have set up Stripe, Data Connect, and configured your App Hosting environment, it's time to deploy! +If you have automatic rollouts enabled, simply push your changes. Otherwise, after pushing, go to the +Firebase console and click "Create Rollout". + ## Application Features ### Homepage @@ -148,18 +161,17 @@ To run this project locally, follow these steps: ``` npm install ``` -4. Copy the example environment variables: - ``` - cp .env.example .env.local - ``` - • Fill in the required values (Firebase config, Stripe keys, Google API key, etc.). -5. Start the development server: +4. Fill in `apphosting.yaml` as guided by the comments. +5. Initialize the firebase emulator suite with `firebase init emulators`. You may + create an `apphosting.emulator.yaml` if you choose to use different configurations + during local development or you can test against your production config. +5. Start the emulator ``` - npm run dev + firebase emulators:start ``` 6. Open the application in your browser at: ``` - http://localhost:3000 + http://localhost:5002 ``` --- diff --git a/starters/nextjs/firebase-ecommerce/apphosting.yaml b/starters/nextjs/firebase-ecommerce/apphosting.yaml index 867bcae1..070e8cac 100644 --- a/starters/nextjs/firebase-ecommerce/apphosting.yaml +++ b/starters/nextjs/firebase-ecommerce/apphosting.yaml @@ -4,28 +4,46 @@ runConfig: minInstances: 0 # Environment variables and secrets. +# Grant access to secrets in Cloud Secret Manager. +# See https://firebase.google.com/docs/app-hosting/configure#secret-parameters +# If you would like to change any keys' values in local development with the emulator +# (e.g. using Stripe Sandbox keys), you can overwrite values in apphosting.emulator.yaml env: - # Grant access to secrets in Cloud Secret Manager. - # See https://firebase.google.com/docs/app-hosting/configure#secret-parameters - - variable: NEXT_PUBLIC_FIREBASE_API_KEY - secret: FIREBASE_API_KEY - - variable: NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN - secret: FIREBASE_AUTH_DOMAIN - - variable: NEXT_PUBLIC_FIREBASE_PROJECT_ID - secret: FIREBASE_PROJECT_ID - - variable: NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET - secret: FIREBASE_STORAGE_BUCKET - - variable: NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID - secret: FIREBASE_MESSAGING_SENDER_ID - - variable: NEXT_PUBLIC_FIREBASE_APP_ID - secret: FIREBASE_APP_ID - - variable: GOOGLE_API_KEY - secret: GOOGLE_API_KEY - - variable: STRIPE_ACCOUNT_ID - secret: STRIPE_ACCOUNT_ID - - variable: STRIPE_SECRET_KEY - secret: STRIPE_SECRET_KEY - - variable: NEXT_PUBLIC_STRIPE_PUB_KEY - secret: STRIPE_PUB_KEY - - variable: STRIPE_WEBHOOK_SECRET - secret: STRIPE_WEBHOOK_SECRET + # Values for Firebase config can be found by clicking the cog next to "Project Overview" + # in the firebase console and clicking "project settings" + # - variable: NEXT_PUBLIC_FIREBASE_API_KEY + # value: + # - variable: NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN + # value: + # - variable: NEXT_PUBLIC_FIREBASE_PROJECT_ID + # value: + # - variable: NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET + # value: + # - variable: NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID + # value: + # - variable: NEXT_PUBLIC_FIREBASE_APP_ID + # value: + + # The Google API key needs access to the Generative AI APIs. Create your key by visiting + # https://ai.google.dev/gemini-api/docs and clicking "Get a Gemini API Key" + # You can then run `firebase apphosting:secrets:set google-api-key and pasting the value. + # - variable: GOOGLE_API_KEY + # secret: google-api-key + + # To use stripe, you must create an account on stripe.com. From the stripe dashboard + # You can copy the NEXT_PUBLIC_STRIPE_PUB_KEY from "Publishable key" in the dashboard. + # You can set STRIPE_SECRET_KEY by calling `firebase apphosting:secrets:set stripe-secret-key` + # and pasting the value listed as "Secret key" in the dashboard. + # To get the stripe webhook secret, create a stripe webhook as described in README.md, + # go to the webhook details page and click "Reveal" under "Signing secret". Copy that value, + # run `firebase apphosting:secrets:set stripe-webhook-secret` and paste the secret value when + # prompted. The value for STRIPE_ACCOUNT_ID can be found in the upper right corner of the + # webhook details page. + # - variable: NEXT_PUBLIC_STRIPE_PUB_KEY + # value: + # - variable: STRIPE_SECRET_KEY + # secret: stripe-secret-key + # - variable: STRIPE_ACCOUNT_ID + # value: + # - variable: STRIPE_WEBHOOK_SECRET + # secret: stripe-webhook-secret diff --git a/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/README.md b/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/README.md deleted file mode 100644 index 53d46e2e..00000000 --- a/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/README.md +++ /dev/null @@ -1,1969 +0,0 @@ -# Table of Contents -- [**Overview**](#generated-typescript-readme) -- [**Accessing the connector**](#accessing-the-connector) - - [*Connecting to the local Emulator*](#connecting-to-the-local-emulator) -- [**Queries**](#queries) - - [*ListCustomers*](#listcustomers) - - [*GetReviewsByHandle*](#getreviewsbyhandle) - - [*GetProductByHandle*](#getproductbyhandle) - - [*GetCollectionByHandle*](#getcollectionbyhandle) - - [*GetCollectionsByPage*](#getcollectionsbypage) - - [*SearchProductDescriptionUsingL2Similarity*](#searchproductdescriptionusingl2similarity) - - [*SearchProductTitleUsingL2Similarity*](#searchproducttitleusingl2similarity) - - [*SearchProductReviewContentUsingL2Similarity*](#searchproductreviewcontentusingl2similarity) - - [*GetOrdersByCustomerId*](#getordersbycustomerid) - - [*GetCurrentCustomerOrders*](#getcurrentcustomerorders) - - [*GetOrderById*](#getorderbyid) -- [**Mutations**](#mutations) - - [*UpsertCustomer*](#upsertcustomer) - - [*CreateProductReview*](#createproductreview) - - [*CreateOrder*](#createorder) - - [*UpdateOrderByPaymentIntentId*](#updateorderbypaymentintentid) - - [*UpdateOrderByChargeId*](#updateorderbychargeid) - - [*CreateOrderItem*](#createorderitem) - -# Generated TypeScript README -This README will guide you through the process of using the generated TypeScript SDK package for the connector `default`. It will also provide examples on how to use your generated SDK to call your Data Connect queries and mutations. - -***NOTE:** This README is generated alongside the generated SDK. If you make changes to this file, they will be overwritten when the SDK is regenerated.* - -You can use this generated SDK by importing from the package `@firebasegen/default-connector` as shown below. Both CommonJS and ESM imports are supported. - -You can also follow the instructions from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#set-client). - -# Accessing the connector -A connector is a collection of Queries and Mutations. One SDK is generated for each connector - this SDK is generated for the connector `default`. - -You can find more information about connectors in the [Data Connect documentation](https://firebase.google.com/docs/data-connect#how-does). - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@firebasegen/default-connector'; - -const dataConnect = getDataConnect(connectorConfig); -``` - -## Connecting to the local Emulator -By default, the connector will connect to the production service. - -To connect to the emulator, you can use the following code. -You can also follow the emulator instructions from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#instrument-clients). - -```javascript -import { connectDataConnectEmulator, getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig } from '@firebasegen/default-connector'; - -const dataConnect = getDataConnect(connectorConfig); -connectDataConnectEmulator(dataConnect, 'localhost', 9399); -``` - -After it's initialized, you can call your Data Connect [queries](#queries) and [mutations](#mutations) from your generated SDK. - -# Queries - -There are two ways to execute a Data Connect Query using the generated Web SDK: -- Using a Query Reference function, which returns a `QueryRef` - - The `QueryRef` can be used as an argument to `executeQuery()`, which will execute the Query and return a `QueryPromise` -- Using an action shortcut function, which returns a `QueryPromise` - - Calling the action shortcut function will execute the Query and return a `QueryPromise` - -The following is true for both the action shortcut function and the `QueryRef` function: -- The `QueryPromise` returned will resolve to the result of the Query once it has finished executing -- If the Query accepts arguments, both the action shortcut function and the `QueryRef` function accept a single argument: an object that contains all the required variables (and the optional variables) for the Query -- Both functions can be called with or without passing in a `DataConnect` instance as an argument. If no `DataConnect` argument is passed in, then the generated SDK will call `getDataConnect(connectorConfig)` behind the scenes for you. - -Below are examples of how to use the `default` connector's generated functions to execute each query. You can also follow the examples from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#using-queries). - -## ListCustomers -You can execute the `ListCustomers` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -listCustomers(): QueryPromise; - -listCustomersRef(): QueryRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```javascript -listCustomers(dc: DataConnect): QueryPromise; - -listCustomersRef(dc: DataConnect): QueryRef; -``` - -### Variables -The `ListCustomers` query has no variables. -### Return Type -Recall that executing the `ListCustomers` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `ListCustomersData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface ListCustomersData { - customers: ({ - id: string; - firstName: string; - lastName: string; - email: string; - } & Customer_Key)[]; -} -``` -### Using `ListCustomers`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, listCustomers } from '@firebasegen/default-connector'; - - -// Call the `listCustomers()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await listCustomers(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await listCustomers(dataConnect); - -console.log(data.customers); - -// Or, you can use the `Promise` API. -listCustomers().then((response) => { - const data = response.data; - console.log(data.customers); -}); -``` - -### Using `ListCustomers`'s `QueryRef` function - -```javascript -import { getDataConnect, DataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, listCustomersRef } from '@firebasegen/default-connector'; - - -// Call the `listCustomersRef()` function to get a reference to the query. -const ref = listCustomersRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = listCustomersRef(dataConnect); - -// Call `executeQuery()` on the reference to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeQuery(ref); - -console.log(data.customers); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.customers); -}); -``` - -## GetReviewsByHandle -You can execute the `GetReviewsByHandle` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -getReviewsByHandle(vars: GetReviewsByHandleVariables): QueryPromise; - -getReviewsByHandleRef(vars: GetReviewsByHandleVariables): QueryRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```javascript -getReviewsByHandle(dc: DataConnect, vars: GetReviewsByHandleVariables): QueryPromise; - -getReviewsByHandleRef(dc: DataConnect, vars: GetReviewsByHandleVariables): QueryRef; -``` - -### Variables -The `GetReviewsByHandle` query requires an argument of type `GetReviewsByHandleVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface GetReviewsByHandleVariables { - handle: string; -} -``` -### Return Type -Recall that executing the `GetReviewsByHandle` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetReviewsByHandleData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface GetReviewsByHandleData { - products: ({ - productReviews_on_product: ({ - id: UUIDString; - rating: number; - content: string; - date: DateString; - customer: { - id: string; - firstName: string; - lastName: string; - } & Customer_Key; - })[]; - })[]; -} -``` -### Using `GetReviewsByHandle`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, getReviewsByHandle, GetReviewsByHandleVariables } from '@firebasegen/default-connector'; - -// The `GetReviewsByHandle` query requires an argument of type `GetReviewsByHandleVariables`: -const getReviewsByHandleVars: GetReviewsByHandleVariables = { - handle: ..., -}; - -// Call the `getReviewsByHandle()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getReviewsByHandle(getReviewsByHandleVars); -// Variables can be defined inline as well. -const { data } = await getReviewsByHandle({ handle: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getReviewsByHandle(dataConnect, getReviewsByHandleVars); - -console.log(data.products); - -// Or, you can use the `Promise` API. -getReviewsByHandle(getReviewsByHandleVars).then((response) => { - const data = response.data; - console.log(data.products); -}); -``` - -### Using `GetReviewsByHandle`'s `QueryRef` function - -```javascript -import { getDataConnect, DataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getReviewsByHandleRef, GetReviewsByHandleVariables } from '@firebasegen/default-connector'; - -// The `GetReviewsByHandle` query requires an argument of type `GetReviewsByHandleVariables`: -const getReviewsByHandleVars: GetReviewsByHandleVariables = { - handle: ..., -}; - -// Call the `getReviewsByHandleRef()` function to get a reference to the query. -const ref = getReviewsByHandleRef(getReviewsByHandleVars); -// Variables can be defined inline as well. -const ref = getReviewsByHandleRef({ handle: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getReviewsByHandleRef(dataConnect, getReviewsByHandleVars); - -// Call `executeQuery()` on the reference to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeQuery(ref); - -console.log(data.products); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.products); -}); -``` - -## GetProductByHandle -You can execute the `GetProductByHandle` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -getProductByHandle(vars: GetProductByHandleVariables): QueryPromise; - -getProductByHandleRef(vars: GetProductByHandleVariables): QueryRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```javascript -getProductByHandle(dc: DataConnect, vars: GetProductByHandleVariables): QueryPromise; - -getProductByHandleRef(dc: DataConnect, vars: GetProductByHandleVariables): QueryRef; -``` - -### Variables -The `GetProductByHandle` query requires an argument of type `GetProductByHandleVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface GetProductByHandleVariables { - handle: string; -} -``` -### Return Type -Recall that executing the `GetProductByHandle` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetProductByHandleData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface GetProductByHandleData { - product?: { - id: UUIDString; - title: string; - description?: string | null; - handle: string; - availableForSale: boolean; - createdAt: DateString; - updatedAt: DateString; - featuredImage?: { - url: string; - width: number; - height: number; - altText?: string | null; - }; - seo?: { - title: string; - description: string; - keywords: string; - }; - productVariants_on_product: ({ - id: UUIDString; - price: number; - availableForSale: boolean; - inventoryQuantity: number; - selectedOptions_on_productVariant: ({ - name?: string | null; - value?: string | null; - })[]; - } & ProductVariant_Key)[]; - productImages_on_product: ({ - id: UUIDString; - url: string; - altText?: string | null; - width: number; - height: number; - displayPosition: number; - } & ProductImage_Key)[]; - } & Product_Key; -} -``` -### Using `GetProductByHandle`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, getProductByHandle, GetProductByHandleVariables } from '@firebasegen/default-connector'; - -// The `GetProductByHandle` query requires an argument of type `GetProductByHandleVariables`: -const getProductByHandleVars: GetProductByHandleVariables = { - handle: ..., -}; - -// Call the `getProductByHandle()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getProductByHandle(getProductByHandleVars); -// Variables can be defined inline as well. -const { data } = await getProductByHandle({ handle: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getProductByHandle(dataConnect, getProductByHandleVars); - -console.log(data.product); - -// Or, you can use the `Promise` API. -getProductByHandle(getProductByHandleVars).then((response) => { - const data = response.data; - console.log(data.product); -}); -``` - -### Using `GetProductByHandle`'s `QueryRef` function - -```javascript -import { getDataConnect, DataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getProductByHandleRef, GetProductByHandleVariables } from '@firebasegen/default-connector'; - -// The `GetProductByHandle` query requires an argument of type `GetProductByHandleVariables`: -const getProductByHandleVars: GetProductByHandleVariables = { - handle: ..., -}; - -// Call the `getProductByHandleRef()` function to get a reference to the query. -const ref = getProductByHandleRef(getProductByHandleVars); -// Variables can be defined inline as well. -const ref = getProductByHandleRef({ handle: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getProductByHandleRef(dataConnect, getProductByHandleVars); - -// Call `executeQuery()` on the reference to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeQuery(ref); - -console.log(data.product); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.product); -}); -``` - -## GetCollectionByHandle -You can execute the `GetCollectionByHandle` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -getCollectionByHandle(vars: GetCollectionByHandleVariables): QueryPromise; - -getCollectionByHandleRef(vars: GetCollectionByHandleVariables): QueryRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```javascript -getCollectionByHandle(dc: DataConnect, vars: GetCollectionByHandleVariables): QueryPromise; - -getCollectionByHandleRef(dc: DataConnect, vars: GetCollectionByHandleVariables): QueryRef; -``` - -### Variables -The `GetCollectionByHandle` query requires an argument of type `GetCollectionByHandleVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface GetCollectionByHandleVariables { - handle: string; - page?: string | null; -} -``` -### Return Type -Recall that executing the `GetCollectionByHandle` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetCollectionByHandleData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface GetCollectionByHandleData { - collections: ({ - id: UUIDString; - name: string; - description?: string | null; - page?: string | null; - featuredImage?: { - url: string; - width: number; - height: number; - altText?: string | null; - }; - seo?: { - title: string; - description: string; - keywords: string; - }; - products_via_ProductCollection: ({ - id: UUIDString; - title: string; - handle: string; - description?: string | null; - availableForSale: boolean; - createdAt: DateString; - updatedAt: DateString; - productVariants_on_product: ({ - id: UUIDString; - price: number; - availableForSale: boolean; - inventoryQuantity: number; - selectedOptions_on_productVariant: ({ - name?: string | null; - value?: string | null; - })[]; - } & ProductVariant_Key)[]; - productImages_on_product: ({ - id: UUIDString; - url: string; - altText?: string | null; - width: number; - height: number; - displayPosition: number; - } & ProductImage_Key)[]; - } & Product_Key)[]; - } & Collection_Key)[]; -} -``` -### Using `GetCollectionByHandle`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, getCollectionByHandle, GetCollectionByHandleVariables } from '@firebasegen/default-connector'; - -// The `GetCollectionByHandle` query requires an argument of type `GetCollectionByHandleVariables`: -const getCollectionByHandleVars: GetCollectionByHandleVariables = { - handle: ..., - page: ..., // optional -}; - -// Call the `getCollectionByHandle()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getCollectionByHandle(getCollectionByHandleVars); -// Variables can be defined inline as well. -const { data } = await getCollectionByHandle({ handle: ..., page: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getCollectionByHandle(dataConnect, getCollectionByHandleVars); - -console.log(data.collections); - -// Or, you can use the `Promise` API. -getCollectionByHandle(getCollectionByHandleVars).then((response) => { - const data = response.data; - console.log(data.collections); -}); -``` - -### Using `GetCollectionByHandle`'s `QueryRef` function - -```javascript -import { getDataConnect, DataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getCollectionByHandleRef, GetCollectionByHandleVariables } from '@firebasegen/default-connector'; - -// The `GetCollectionByHandle` query requires an argument of type `GetCollectionByHandleVariables`: -const getCollectionByHandleVars: GetCollectionByHandleVariables = { - handle: ..., - page: ..., // optional -}; - -// Call the `getCollectionByHandleRef()` function to get a reference to the query. -const ref = getCollectionByHandleRef(getCollectionByHandleVars); -// Variables can be defined inline as well. -const ref = getCollectionByHandleRef({ handle: ..., page: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getCollectionByHandleRef(dataConnect, getCollectionByHandleVars); - -// Call `executeQuery()` on the reference to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeQuery(ref); - -console.log(data.collections); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.collections); -}); -``` - -## GetCollectionsByPage -You can execute the `GetCollectionsByPage` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -getCollectionsByPage(vars?: GetCollectionsByPageVariables): QueryPromise; - -getCollectionsByPageRef(vars?: GetCollectionsByPageVariables): QueryRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```javascript -getCollectionsByPage(dc: DataConnect, vars?: GetCollectionsByPageVariables): QueryPromise; - -getCollectionsByPageRef(dc: DataConnect, vars?: GetCollectionsByPageVariables): QueryRef; -``` - -### Variables -The `GetCollectionsByPage` query has an optional argument of type `GetCollectionsByPageVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface GetCollectionsByPageVariables { - page?: string | null; -} -``` -### Return Type -Recall that executing the `GetCollectionsByPage` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetCollectionsByPageData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface GetCollectionsByPageData { - collections: ({ - id: UUIDString; - name: string; - description?: string | null; - handle: string; - page?: string | null; - featuredImage?: { - url: string; - width: number; - height: number; - altText?: string | null; - }; - products_via_ProductCollection: ({ - id: UUIDString; - title: string; - handle: string; - description?: string | null; - productVariants_on_product: ({ - id: UUIDString; - price: number; - selectedOptions_on_productVariant: ({ - name?: string | null; - value?: string | null; - })[]; - } & ProductVariant_Key)[]; - productImages_on_product: ({ - id: UUIDString; - url: string; - altText?: string | null; - width: number; - height: number; - displayPosition: number; - } & ProductImage_Key)[]; - } & Product_Key)[]; - } & Collection_Key)[]; -} -``` -### Using `GetCollectionsByPage`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, getCollectionsByPage, GetCollectionsByPageVariables } from '@firebasegen/default-connector'; - -// The `GetCollectionsByPage` query has an optional argument of type `GetCollectionsByPageVariables`: -const getCollectionsByPageVars: GetCollectionsByPageVariables = { - page: ..., // optional -}; - -// Call the `getCollectionsByPage()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getCollectionsByPage(getCollectionsByPageVars); -// Variables can be defined inline as well. -const { data } = await getCollectionsByPage({ page: ..., }); -// Since all variables are optional for this query, you can omit the `GetCollectionsByPageVariables` argument. -const { data } = await getCollectionsByPage(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getCollectionsByPage(dataConnect, getCollectionsByPageVars); - -console.log(data.collections); - -// Or, you can use the `Promise` API. -getCollectionsByPage(getCollectionsByPageVars).then((response) => { - const data = response.data; - console.log(data.collections); -}); -``` - -### Using `GetCollectionsByPage`'s `QueryRef` function - -```javascript -import { getDataConnect, DataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getCollectionsByPageRef, GetCollectionsByPageVariables } from '@firebasegen/default-connector'; - -// The `GetCollectionsByPage` query has an optional argument of type `GetCollectionsByPageVariables`: -const getCollectionsByPageVars: GetCollectionsByPageVariables = { - page: ..., // optional -}; - -// Call the `getCollectionsByPageRef()` function to get a reference to the query. -const ref = getCollectionsByPageRef(getCollectionsByPageVars); -// Variables can be defined inline as well. -const ref = getCollectionsByPageRef({ page: ..., }); -// Since all variables are optional for this query, you can omit the `GetCollectionsByPageVariables` argument. -const ref = getCollectionsByPageRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getCollectionsByPageRef(dataConnect, getCollectionsByPageVars); - -// Call `executeQuery()` on the reference to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeQuery(ref); - -console.log(data.collections); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.collections); -}); -``` - -## SearchProductDescriptionUsingL2Similarity -You can execute the `SearchProductDescriptionUsingL2Similarity` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -searchProductDescriptionUsingL2similarity(vars: SearchProductDescriptionUsingL2similarityVariables): QueryPromise; - -searchProductDescriptionUsingL2similarityRef(vars: SearchProductDescriptionUsingL2similarityVariables): QueryRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```javascript -searchProductDescriptionUsingL2similarity(dc: DataConnect, vars: SearchProductDescriptionUsingL2similarityVariables): QueryPromise; - -searchProductDescriptionUsingL2similarityRef(dc: DataConnect, vars: SearchProductDescriptionUsingL2similarityVariables): QueryRef; -``` - -### Variables -The `SearchProductDescriptionUsingL2Similarity` query requires an argument of type `SearchProductDescriptionUsingL2similarityVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface SearchProductDescriptionUsingL2similarityVariables { - query: string; -} -``` -### Return Type -Recall that executing the `SearchProductDescriptionUsingL2Similarity` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `SearchProductDescriptionUsingL2similarityData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface SearchProductDescriptionUsingL2similarityData { - products_descriptionEmbedding_similarity: ({ - id: UUIDString; - handle: string; - title: string; - } & Product_Key)[]; -} -``` -### Using `SearchProductDescriptionUsingL2Similarity`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, searchProductDescriptionUsingL2similarity, SearchProductDescriptionUsingL2similarityVariables } from '@firebasegen/default-connector'; - -// The `SearchProductDescriptionUsingL2Similarity` query requires an argument of type `SearchProductDescriptionUsingL2similarityVariables`: -const searchProductDescriptionUsingL2similarityVars: SearchProductDescriptionUsingL2similarityVariables = { - query: ..., -}; - -// Call the `searchProductDescriptionUsingL2similarity()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await searchProductDescriptionUsingL2similarity(searchProductDescriptionUsingL2similarityVars); -// Variables can be defined inline as well. -const { data } = await searchProductDescriptionUsingL2similarity({ query: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await searchProductDescriptionUsingL2similarity(dataConnect, searchProductDescriptionUsingL2similarityVars); - -console.log(data.products_descriptionEmbedding_similarity); - -// Or, you can use the `Promise` API. -searchProductDescriptionUsingL2similarity(searchProductDescriptionUsingL2similarityVars).then((response) => { - const data = response.data; - console.log(data.products_descriptionEmbedding_similarity); -}); -``` - -### Using `SearchProductDescriptionUsingL2Similarity`'s `QueryRef` function - -```javascript -import { getDataConnect, DataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, searchProductDescriptionUsingL2similarityRef, SearchProductDescriptionUsingL2similarityVariables } from '@firebasegen/default-connector'; - -// The `SearchProductDescriptionUsingL2Similarity` query requires an argument of type `SearchProductDescriptionUsingL2similarityVariables`: -const searchProductDescriptionUsingL2similarityVars: SearchProductDescriptionUsingL2similarityVariables = { - query: ..., -}; - -// Call the `searchProductDescriptionUsingL2similarityRef()` function to get a reference to the query. -const ref = searchProductDescriptionUsingL2similarityRef(searchProductDescriptionUsingL2similarityVars); -// Variables can be defined inline as well. -const ref = searchProductDescriptionUsingL2similarityRef({ query: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = searchProductDescriptionUsingL2similarityRef(dataConnect, searchProductDescriptionUsingL2similarityVars); - -// Call `executeQuery()` on the reference to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeQuery(ref); - -console.log(data.products_descriptionEmbedding_similarity); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.products_descriptionEmbedding_similarity); -}); -``` - -## SearchProductTitleUsingL2Similarity -You can execute the `SearchProductTitleUsingL2Similarity` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -searchProductTitleUsingL2similarity(vars: SearchProductTitleUsingL2similarityVariables): QueryPromise; - -searchProductTitleUsingL2similarityRef(vars: SearchProductTitleUsingL2similarityVariables): QueryRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```javascript -searchProductTitleUsingL2similarity(dc: DataConnect, vars: SearchProductTitleUsingL2similarityVariables): QueryPromise; - -searchProductTitleUsingL2similarityRef(dc: DataConnect, vars: SearchProductTitleUsingL2similarityVariables): QueryRef; -``` - -### Variables -The `SearchProductTitleUsingL2Similarity` query requires an argument of type `SearchProductTitleUsingL2similarityVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface SearchProductTitleUsingL2similarityVariables { - query: string; -} -``` -### Return Type -Recall that executing the `SearchProductTitleUsingL2Similarity` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `SearchProductTitleUsingL2similarityData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface SearchProductTitleUsingL2similarityData { - products_titleEmbedding_similarity: ({ - id: UUIDString; - handle: string; - title: string; - } & Product_Key)[]; -} -``` -### Using `SearchProductTitleUsingL2Similarity`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, searchProductTitleUsingL2similarity, SearchProductTitleUsingL2similarityVariables } from '@firebasegen/default-connector'; - -// The `SearchProductTitleUsingL2Similarity` query requires an argument of type `SearchProductTitleUsingL2similarityVariables`: -const searchProductTitleUsingL2similarityVars: SearchProductTitleUsingL2similarityVariables = { - query: ..., -}; - -// Call the `searchProductTitleUsingL2similarity()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await searchProductTitleUsingL2similarity(searchProductTitleUsingL2similarityVars); -// Variables can be defined inline as well. -const { data } = await searchProductTitleUsingL2similarity({ query: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await searchProductTitleUsingL2similarity(dataConnect, searchProductTitleUsingL2similarityVars); - -console.log(data.products_titleEmbedding_similarity); - -// Or, you can use the `Promise` API. -searchProductTitleUsingL2similarity(searchProductTitleUsingL2similarityVars).then((response) => { - const data = response.data; - console.log(data.products_titleEmbedding_similarity); -}); -``` - -### Using `SearchProductTitleUsingL2Similarity`'s `QueryRef` function - -```javascript -import { getDataConnect, DataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, searchProductTitleUsingL2similarityRef, SearchProductTitleUsingL2similarityVariables } from '@firebasegen/default-connector'; - -// The `SearchProductTitleUsingL2Similarity` query requires an argument of type `SearchProductTitleUsingL2similarityVariables`: -const searchProductTitleUsingL2similarityVars: SearchProductTitleUsingL2similarityVariables = { - query: ..., -}; - -// Call the `searchProductTitleUsingL2similarityRef()` function to get a reference to the query. -const ref = searchProductTitleUsingL2similarityRef(searchProductTitleUsingL2similarityVars); -// Variables can be defined inline as well. -const ref = searchProductTitleUsingL2similarityRef({ query: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = searchProductTitleUsingL2similarityRef(dataConnect, searchProductTitleUsingL2similarityVars); - -// Call `executeQuery()` on the reference to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeQuery(ref); - -console.log(data.products_titleEmbedding_similarity); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.products_titleEmbedding_similarity); -}); -``` - -## SearchProductReviewContentUsingL2Similarity -You can execute the `SearchProductReviewContentUsingL2Similarity` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -searchProductReviewContentUsingL2similarity(vars: SearchProductReviewContentUsingL2similarityVariables): QueryPromise; - -searchProductReviewContentUsingL2similarityRef(vars: SearchProductReviewContentUsingL2similarityVariables): QueryRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```javascript -searchProductReviewContentUsingL2similarity(dc: DataConnect, vars: SearchProductReviewContentUsingL2similarityVariables): QueryPromise; - -searchProductReviewContentUsingL2similarityRef(dc: DataConnect, vars: SearchProductReviewContentUsingL2similarityVariables): QueryRef; -``` - -### Variables -The `SearchProductReviewContentUsingL2Similarity` query requires an argument of type `SearchProductReviewContentUsingL2similarityVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface SearchProductReviewContentUsingL2similarityVariables { - query: string; -} -``` -### Return Type -Recall that executing the `SearchProductReviewContentUsingL2Similarity` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `SearchProductReviewContentUsingL2similarityData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface SearchProductReviewContentUsingL2similarityData { - productReviews_contentEmbedding_similarity: ({ - product: { - id: UUIDString; - title: string; - handle: string; - } & Product_Key; - })[]; -} -``` -### Using `SearchProductReviewContentUsingL2Similarity`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, searchProductReviewContentUsingL2similarity, SearchProductReviewContentUsingL2similarityVariables } from '@firebasegen/default-connector'; - -// The `SearchProductReviewContentUsingL2Similarity` query requires an argument of type `SearchProductReviewContentUsingL2similarityVariables`: -const searchProductReviewContentUsingL2similarityVars: SearchProductReviewContentUsingL2similarityVariables = { - query: ..., -}; - -// Call the `searchProductReviewContentUsingL2similarity()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await searchProductReviewContentUsingL2similarity(searchProductReviewContentUsingL2similarityVars); -// Variables can be defined inline as well. -const { data } = await searchProductReviewContentUsingL2similarity({ query: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await searchProductReviewContentUsingL2similarity(dataConnect, searchProductReviewContentUsingL2similarityVars); - -console.log(data.productReviews_contentEmbedding_similarity); - -// Or, you can use the `Promise` API. -searchProductReviewContentUsingL2similarity(searchProductReviewContentUsingL2similarityVars).then((response) => { - const data = response.data; - console.log(data.productReviews_contentEmbedding_similarity); -}); -``` - -### Using `SearchProductReviewContentUsingL2Similarity`'s `QueryRef` function - -```javascript -import { getDataConnect, DataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, searchProductReviewContentUsingL2similarityRef, SearchProductReviewContentUsingL2similarityVariables } from '@firebasegen/default-connector'; - -// The `SearchProductReviewContentUsingL2Similarity` query requires an argument of type `SearchProductReviewContentUsingL2similarityVariables`: -const searchProductReviewContentUsingL2similarityVars: SearchProductReviewContentUsingL2similarityVariables = { - query: ..., -}; - -// Call the `searchProductReviewContentUsingL2similarityRef()` function to get a reference to the query. -const ref = searchProductReviewContentUsingL2similarityRef(searchProductReviewContentUsingL2similarityVars); -// Variables can be defined inline as well. -const ref = searchProductReviewContentUsingL2similarityRef({ query: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = searchProductReviewContentUsingL2similarityRef(dataConnect, searchProductReviewContentUsingL2similarityVars); - -// Call `executeQuery()` on the reference to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeQuery(ref); - -console.log(data.productReviews_contentEmbedding_similarity); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.productReviews_contentEmbedding_similarity); -}); -``` - -## GetOrdersByCustomerId -You can execute the `GetOrdersByCustomerId` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -getOrdersByCustomerId(vars: GetOrdersByCustomerIdVariables): QueryPromise; - -getOrdersByCustomerIdRef(vars: GetOrdersByCustomerIdVariables): QueryRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```javascript -getOrdersByCustomerId(dc: DataConnect, vars: GetOrdersByCustomerIdVariables): QueryPromise; - -getOrdersByCustomerIdRef(dc: DataConnect, vars: GetOrdersByCustomerIdVariables): QueryRef; -``` - -### Variables -The `GetOrdersByCustomerId` query requires an argument of type `GetOrdersByCustomerIdVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface GetOrdersByCustomerIdVariables { - customerId: string; -} -``` -### Return Type -Recall that executing the `GetOrdersByCustomerId` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetOrdersByCustomerIdData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface GetOrdersByCustomerIdData { - orders: ({ - id: UUIDString; - customerId: string; - processedAt: DateString; - chargeId?: string | null; - paymentIntentId?: string | null; - receiptUrl?: string | null; - subtotalPrice: number; - totalPrice: number; - financialStatus: string; - fulfillmentStatus: string; - orderItems_on_order: ({ - id: UUIDString; - quantity: number; - price: number; - product: { - id: UUIDString; - title: string; - handle: string; - productImages_on_product: ({ - url: string; - altText?: string | null; - width: number; - height: number; - })[]; - } & Product_Key; - } & OrderItem_Key)[]; - } & Order_Key)[]; -} -``` -### Using `GetOrdersByCustomerId`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, getOrdersByCustomerId, GetOrdersByCustomerIdVariables } from '@firebasegen/default-connector'; - -// The `GetOrdersByCustomerId` query requires an argument of type `GetOrdersByCustomerIdVariables`: -const getOrdersByCustomerIdVars: GetOrdersByCustomerIdVariables = { - customerId: ..., -}; - -// Call the `getOrdersByCustomerId()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getOrdersByCustomerId(getOrdersByCustomerIdVars); -// Variables can be defined inline as well. -const { data } = await getOrdersByCustomerId({ customerId: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getOrdersByCustomerId(dataConnect, getOrdersByCustomerIdVars); - -console.log(data.orders); - -// Or, you can use the `Promise` API. -getOrdersByCustomerId(getOrdersByCustomerIdVars).then((response) => { - const data = response.data; - console.log(data.orders); -}); -``` - -### Using `GetOrdersByCustomerId`'s `QueryRef` function - -```javascript -import { getDataConnect, DataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getOrdersByCustomerIdRef, GetOrdersByCustomerIdVariables } from '@firebasegen/default-connector'; - -// The `GetOrdersByCustomerId` query requires an argument of type `GetOrdersByCustomerIdVariables`: -const getOrdersByCustomerIdVars: GetOrdersByCustomerIdVariables = { - customerId: ..., -}; - -// Call the `getOrdersByCustomerIdRef()` function to get a reference to the query. -const ref = getOrdersByCustomerIdRef(getOrdersByCustomerIdVars); -// Variables can be defined inline as well. -const ref = getOrdersByCustomerIdRef({ customerId: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getOrdersByCustomerIdRef(dataConnect, getOrdersByCustomerIdVars); - -// Call `executeQuery()` on the reference to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeQuery(ref); - -console.log(data.orders); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.orders); -}); -``` - -## GetCurrentCustomerOrders -You can execute the `GetCurrentCustomerOrders` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -getCurrentCustomerOrders(): QueryPromise; - -getCurrentCustomerOrdersRef(): QueryRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```javascript -getCurrentCustomerOrders(dc: DataConnect): QueryPromise; - -getCurrentCustomerOrdersRef(dc: DataConnect): QueryRef; -``` - -### Variables -The `GetCurrentCustomerOrders` query has no variables. -### Return Type -Recall that executing the `GetCurrentCustomerOrders` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetCurrentCustomerOrdersData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface GetCurrentCustomerOrdersData { - orders?: { - orders_on_customer: ({ - id: UUIDString; - processedAt: DateString; - chargeId?: string | null; - paymentIntentId?: string | null; - receiptUrl?: string | null; - subtotalPrice: number; - totalPrice: number; - financialStatus: string; - fulfillmentStatus: string; - orderItems_on_order: ({ - id: UUIDString; - quantity: number; - price: number; - product: { - id: UUIDString; - title: string; - handle: string; - productImages_on_product: ({ - url: string; - altText?: string | null; - width: number; - height: number; - })[]; - } & Product_Key; - } & OrderItem_Key)[]; - } & Order_Key)[]; - }; -} -``` -### Using `GetCurrentCustomerOrders`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, getCurrentCustomerOrders } from '@firebasegen/default-connector'; - - -// Call the `getCurrentCustomerOrders()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getCurrentCustomerOrders(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getCurrentCustomerOrders(dataConnect); - -console.log(data.orders); - -// Or, you can use the `Promise` API. -getCurrentCustomerOrders().then((response) => { - const data = response.data; - console.log(data.orders); -}); -``` - -### Using `GetCurrentCustomerOrders`'s `QueryRef` function - -```javascript -import { getDataConnect, DataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getCurrentCustomerOrdersRef } from '@firebasegen/default-connector'; - - -// Call the `getCurrentCustomerOrdersRef()` function to get a reference to the query. -const ref = getCurrentCustomerOrdersRef(); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getCurrentCustomerOrdersRef(dataConnect); - -// Call `executeQuery()` on the reference to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeQuery(ref); - -console.log(data.orders); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.orders); -}); -``` - -## GetOrderById -You can execute the `GetOrderById` query using the following action shortcut function, or by calling `executeQuery()` after calling the following `QueryRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -getOrderById(vars: GetOrderByIdVariables): QueryPromise; - -getOrderByIdRef(vars: GetOrderByIdVariables): QueryRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `QueryRef` function. -```javascript -getOrderById(dc: DataConnect, vars: GetOrderByIdVariables): QueryPromise; - -getOrderByIdRef(dc: DataConnect, vars: GetOrderByIdVariables): QueryRef; -``` - -### Variables -The `GetOrderById` query requires an argument of type `GetOrderByIdVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface GetOrderByIdVariables { - id: UUIDString; -} -``` -### Return Type -Recall that executing the `GetOrderById` query returns a `QueryPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `GetOrderByIdData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface GetOrderByIdData { - order?: { - id: UUIDString; - customerId: string; - processedAt: DateString; - receiptUrl?: string | null; - totalPrice: number; - financialStatus: string; - fulfillmentStatus: string; - orderItems_on_order: ({ - id: UUIDString; - quantity: number; - price: number; - product: { - id: UUIDString; - title: string; - handle: string; - productImages_on_product: ({ - url: string; - altText?: string | null; - width: number; - height: number; - })[]; - } & Product_Key; - } & OrderItem_Key)[]; - } & Order_Key; -} -``` -### Using `GetOrderById`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, getOrderById, GetOrderByIdVariables } from '@firebasegen/default-connector'; - -// The `GetOrderById` query requires an argument of type `GetOrderByIdVariables`: -const getOrderByIdVars: GetOrderByIdVariables = { - id: ..., -}; - -// Call the `getOrderById()` function to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await getOrderById(getOrderByIdVars); -// Variables can be defined inline as well. -const { data } = await getOrderById({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await getOrderById(dataConnect, getOrderByIdVars); - -console.log(data.order); - -// Or, you can use the `Promise` API. -getOrderById(getOrderByIdVars).then((response) => { - const data = response.data; - console.log(data.order); -}); -``` - -### Using `GetOrderById`'s `QueryRef` function - -```javascript -import { getDataConnect, DataConnect, executeQuery } from 'firebase/data-connect'; -import { connectorConfig, getOrderByIdRef, GetOrderByIdVariables } from '@firebasegen/default-connector'; - -// The `GetOrderById` query requires an argument of type `GetOrderByIdVariables`: -const getOrderByIdVars: GetOrderByIdVariables = { - id: ..., -}; - -// Call the `getOrderByIdRef()` function to get a reference to the query. -const ref = getOrderByIdRef(getOrderByIdVars); -// Variables can be defined inline as well. -const ref = getOrderByIdRef({ id: ..., }); - -// You can also pass in a `DataConnect` instance to the `QueryRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = getOrderByIdRef(dataConnect, getOrderByIdVars); - -// Call `executeQuery()` on the reference to execute the query. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeQuery(ref); - -console.log(data.order); - -// Or, you can use the `Promise` API. -executeQuery(ref).then((response) => { - const data = response.data; - console.log(data.order); -}); -``` - -# Mutations - -There are two ways to execute a Data Connect Mutation using the generated Web SDK: -- Using a Mutation Reference function, which returns a `MutationRef` - - The `MutationRef` can be used as an argument to `executeMutation()`, which will execute the Mutation and return a `MutationPromise` -- Using an action shortcut function, which returns a `MutationPromise` - - Calling the action shortcut function will execute the Mutation and return a `MutationPromise` - -The following is true for both the action shortcut function and the `MutationRef` function: -- The `MutationPromise` returned will resolve to the result of the Mutation once it has finished executing -- If the Mutation accepts arguments, both the action shortcut function and the `MutationRef` function accept a single argument: an object that contains all the required variables (and the optional variables) for the Mutation -- Both functions can be called with or without passing in a `DataConnect` instance as an argument. If no `DataConnect` argument is passed in, then the generated SDK will call `getDataConnect(connectorConfig)` behind the scenes for you. - -Below are examples of how to use the `default` connector's generated functions to execute each mutation. You can also follow the examples from the [Data Connect documentation](https://firebase.google.com/docs/data-connect/web-sdk#using-mutations). - -## UpsertCustomer -You can execute the `UpsertCustomer` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -upsertCustomer(vars: UpsertCustomerVariables): MutationPromise; - -upsertCustomerRef(vars: UpsertCustomerVariables): MutationRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```javascript -upsertCustomer(dc: DataConnect, vars: UpsertCustomerVariables): MutationPromise; - -upsertCustomerRef(dc: DataConnect, vars: UpsertCustomerVariables): MutationRef; -``` - -### Variables -The `UpsertCustomer` mutation requires an argument of type `UpsertCustomerVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface UpsertCustomerVariables { - firstName: string; - lastName: string; - email: string; - phone: string; - acceptsMarketing: boolean; -} -``` -### Return Type -Recall that executing the `UpsertCustomer` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpsertCustomerData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface UpsertCustomerData { - customer_upsert: Customer_Key; -} -``` -### Using `UpsertCustomer`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, upsertCustomer, UpsertCustomerVariables } from '@firebasegen/default-connector'; - -// The `UpsertCustomer` mutation requires an argument of type `UpsertCustomerVariables`: -const upsertCustomerVars: UpsertCustomerVariables = { - firstName: ..., - lastName: ..., - email: ..., - phone: ..., - acceptsMarketing: ..., -}; - -// Call the `upsertCustomer()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await upsertCustomer(upsertCustomerVars); -// Variables can be defined inline as well. -const { data } = await upsertCustomer({ firstName: ..., lastName: ..., email: ..., phone: ..., acceptsMarketing: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await upsertCustomer(dataConnect, upsertCustomerVars); - -console.log(data.customer_upsert); - -// Or, you can use the `Promise` API. -upsertCustomer(upsertCustomerVars).then((response) => { - const data = response.data; - console.log(data.customer_upsert); -}); -``` - -### Using `UpsertCustomer`'s `MutationRef` function - -```javascript -import { getDataConnect, DataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, upsertCustomerRef, UpsertCustomerVariables } from '@firebasegen/default-connector'; - -// The `UpsertCustomer` mutation requires an argument of type `UpsertCustomerVariables`: -const upsertCustomerVars: UpsertCustomerVariables = { - firstName: ..., - lastName: ..., - email: ..., - phone: ..., - acceptsMarketing: ..., -}; - -// Call the `upsertCustomerRef()` function to get a reference to the mutation. -const ref = upsertCustomerRef(upsertCustomerVars); -// Variables can be defined inline as well. -const ref = upsertCustomerRef({ firstName: ..., lastName: ..., email: ..., phone: ..., acceptsMarketing: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = upsertCustomerRef(dataConnect, upsertCustomerVars); - -// Call `executeMutation()` on the reference to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeMutation(ref); - -console.log(data.customer_upsert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.customer_upsert); -}); -``` - -## CreateProductReview -You can execute the `CreateProductReview` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -createProductReview(vars: CreateProductReviewVariables): MutationPromise; - -createProductReviewRef(vars: CreateProductReviewVariables): MutationRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```javascript -createProductReview(dc: DataConnect, vars: CreateProductReviewVariables): MutationPromise; - -createProductReviewRef(dc: DataConnect, vars: CreateProductReviewVariables): MutationRef; -``` - -### Variables -The `CreateProductReview` mutation requires an argument of type `CreateProductReviewVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface CreateProductReviewVariables { - productId: UUIDString; - rating: number; - content: string; -} -``` -### Return Type -Recall that executing the `CreateProductReview` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateProductReviewData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface CreateProductReviewData { - productReview_insert: ProductReview_Key; -} -``` -### Using `CreateProductReview`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, createProductReview, CreateProductReviewVariables } from '@firebasegen/default-connector'; - -// The `CreateProductReview` mutation requires an argument of type `CreateProductReviewVariables`: -const createProductReviewVars: CreateProductReviewVariables = { - productId: ..., - rating: ..., - content: ..., -}; - -// Call the `createProductReview()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createProductReview(createProductReviewVars); -// Variables can be defined inline as well. -const { data } = await createProductReview({ productId: ..., rating: ..., content: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createProductReview(dataConnect, createProductReviewVars); - -console.log(data.productReview_insert); - -// Or, you can use the `Promise` API. -createProductReview(createProductReviewVars).then((response) => { - const data = response.data; - console.log(data.productReview_insert); -}); -``` - -### Using `CreateProductReview`'s `MutationRef` function - -```javascript -import { getDataConnect, DataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createProductReviewRef, CreateProductReviewVariables } from '@firebasegen/default-connector'; - -// The `CreateProductReview` mutation requires an argument of type `CreateProductReviewVariables`: -const createProductReviewVars: CreateProductReviewVariables = { - productId: ..., - rating: ..., - content: ..., -}; - -// Call the `createProductReviewRef()` function to get a reference to the mutation. -const ref = createProductReviewRef(createProductReviewVars); -// Variables can be defined inline as well. -const ref = createProductReviewRef({ productId: ..., rating: ..., content: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createProductReviewRef(dataConnect, createProductReviewVars); - -// Call `executeMutation()` on the reference to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeMutation(ref); - -console.log(data.productReview_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.productReview_insert); -}); -``` - -## CreateOrder -You can execute the `CreateOrder` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -createOrder(vars: CreateOrderVariables): MutationPromise; - -createOrderRef(vars: CreateOrderVariables): MutationRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```javascript -createOrder(dc: DataConnect, vars: CreateOrderVariables): MutationPromise; - -createOrderRef(dc: DataConnect, vars: CreateOrderVariables): MutationRef; -``` - -### Variables -The `CreateOrder` mutation requires an argument of type `CreateOrderVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface CreateOrderVariables { - customerId: string; - chargeId?: string | null; - paymentIntentId?: string | null; - receiptUrl?: string | null; - subtotalPrice: number; - totalTax: number; - totalShippingPrice: number; - totalPrice: number; - financialStatus: string; - fulfillmentStatus: string; -} -``` -### Return Type -Recall that executing the `CreateOrder` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateOrderData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface CreateOrderData { - order_insert: Order_Key; -} -``` -### Using `CreateOrder`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, createOrder, CreateOrderVariables } from '@firebasegen/default-connector'; - -// The `CreateOrder` mutation requires an argument of type `CreateOrderVariables`: -const createOrderVars: CreateOrderVariables = { - customerId: ..., - chargeId: ..., // optional - paymentIntentId: ..., // optional - receiptUrl: ..., // optional - subtotalPrice: ..., - totalTax: ..., - totalShippingPrice: ..., - totalPrice: ..., - financialStatus: ..., - fulfillmentStatus: ..., -}; - -// Call the `createOrder()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createOrder(createOrderVars); -// Variables can be defined inline as well. -const { data } = await createOrder({ customerId: ..., chargeId: ..., paymentIntentId: ..., receiptUrl: ..., subtotalPrice: ..., totalTax: ..., totalShippingPrice: ..., totalPrice: ..., financialStatus: ..., fulfillmentStatus: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createOrder(dataConnect, createOrderVars); - -console.log(data.order_insert); - -// Or, you can use the `Promise` API. -createOrder(createOrderVars).then((response) => { - const data = response.data; - console.log(data.order_insert); -}); -``` - -### Using `CreateOrder`'s `MutationRef` function - -```javascript -import { getDataConnect, DataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createOrderRef, CreateOrderVariables } from '@firebasegen/default-connector'; - -// The `CreateOrder` mutation requires an argument of type `CreateOrderVariables`: -const createOrderVars: CreateOrderVariables = { - customerId: ..., - chargeId: ..., // optional - paymentIntentId: ..., // optional - receiptUrl: ..., // optional - subtotalPrice: ..., - totalTax: ..., - totalShippingPrice: ..., - totalPrice: ..., - financialStatus: ..., - fulfillmentStatus: ..., -}; - -// Call the `createOrderRef()` function to get a reference to the mutation. -const ref = createOrderRef(createOrderVars); -// Variables can be defined inline as well. -const ref = createOrderRef({ customerId: ..., chargeId: ..., paymentIntentId: ..., receiptUrl: ..., subtotalPrice: ..., totalTax: ..., totalShippingPrice: ..., totalPrice: ..., financialStatus: ..., fulfillmentStatus: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createOrderRef(dataConnect, createOrderVars); - -// Call `executeMutation()` on the reference to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeMutation(ref); - -console.log(data.order_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.order_insert); -}); -``` - -## UpdateOrderByPaymentIntentId -You can execute the `UpdateOrderByPaymentIntentId` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -updateOrderByPaymentIntentId(vars: UpdateOrderByPaymentIntentIdVariables): MutationPromise; - -updateOrderByPaymentIntentIdRef(vars: UpdateOrderByPaymentIntentIdVariables): MutationRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```javascript -updateOrderByPaymentIntentId(dc: DataConnect, vars: UpdateOrderByPaymentIntentIdVariables): MutationPromise; - -updateOrderByPaymentIntentIdRef(dc: DataConnect, vars: UpdateOrderByPaymentIntentIdVariables): MutationRef; -``` - -### Variables -The `UpdateOrderByPaymentIntentId` mutation requires an argument of type `UpdateOrderByPaymentIntentIdVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface UpdateOrderByPaymentIntentIdVariables { - paymentIntentId: string; - financialStatus?: string | null; - fulfillmentStatus?: string | null; - receiptUrl?: string | null; - processedAt?: DateString | null; - chargeId?: string | null; -} -``` -### Return Type -Recall that executing the `UpdateOrderByPaymentIntentId` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpdateOrderByPaymentIntentIdData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface UpdateOrderByPaymentIntentIdData { - order_update?: Order_Key | null; -} -``` -### Using `UpdateOrderByPaymentIntentId`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, updateOrderByPaymentIntentId, UpdateOrderByPaymentIntentIdVariables } from '@firebasegen/default-connector'; - -// The `UpdateOrderByPaymentIntentId` mutation requires an argument of type `UpdateOrderByPaymentIntentIdVariables`: -const updateOrderByPaymentIntentIdVars: UpdateOrderByPaymentIntentIdVariables = { - paymentIntentId: ..., - financialStatus: ..., // optional - fulfillmentStatus: ..., // optional - receiptUrl: ..., // optional - processedAt: ..., // optional - chargeId: ..., // optional -}; - -// Call the `updateOrderByPaymentIntentId()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await updateOrderByPaymentIntentId(updateOrderByPaymentIntentIdVars); -// Variables can be defined inline as well. -const { data } = await updateOrderByPaymentIntentId({ paymentIntentId: ..., financialStatus: ..., fulfillmentStatus: ..., receiptUrl: ..., processedAt: ..., chargeId: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await updateOrderByPaymentIntentId(dataConnect, updateOrderByPaymentIntentIdVars); - -console.log(data.order_update); - -// Or, you can use the `Promise` API. -updateOrderByPaymentIntentId(updateOrderByPaymentIntentIdVars).then((response) => { - const data = response.data; - console.log(data.order_update); -}); -``` - -### Using `UpdateOrderByPaymentIntentId`'s `MutationRef` function - -```javascript -import { getDataConnect, DataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, updateOrderByPaymentIntentIdRef, UpdateOrderByPaymentIntentIdVariables } from '@firebasegen/default-connector'; - -// The `UpdateOrderByPaymentIntentId` mutation requires an argument of type `UpdateOrderByPaymentIntentIdVariables`: -const updateOrderByPaymentIntentIdVars: UpdateOrderByPaymentIntentIdVariables = { - paymentIntentId: ..., - financialStatus: ..., // optional - fulfillmentStatus: ..., // optional - receiptUrl: ..., // optional - processedAt: ..., // optional - chargeId: ..., // optional -}; - -// Call the `updateOrderByPaymentIntentIdRef()` function to get a reference to the mutation. -const ref = updateOrderByPaymentIntentIdRef(updateOrderByPaymentIntentIdVars); -// Variables can be defined inline as well. -const ref = updateOrderByPaymentIntentIdRef({ paymentIntentId: ..., financialStatus: ..., fulfillmentStatus: ..., receiptUrl: ..., processedAt: ..., chargeId: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = updateOrderByPaymentIntentIdRef(dataConnect, updateOrderByPaymentIntentIdVars); - -// Call `executeMutation()` on the reference to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeMutation(ref); - -console.log(data.order_update); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.order_update); -}); -``` - -## UpdateOrderByChargeId -You can execute the `UpdateOrderByChargeId` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -updateOrderByChargeId(vars?: UpdateOrderByChargeIdVariables): MutationPromise; - -updateOrderByChargeIdRef(vars?: UpdateOrderByChargeIdVariables): MutationRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```javascript -updateOrderByChargeId(dc: DataConnect, vars?: UpdateOrderByChargeIdVariables): MutationPromise; - -updateOrderByChargeIdRef(dc: DataConnect, vars?: UpdateOrderByChargeIdVariables): MutationRef; -``` - -### Variables -The `UpdateOrderByChargeId` mutation has an optional argument of type `UpdateOrderByChargeIdVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface UpdateOrderByChargeIdVariables { - financialStatus?: string | null; - fulfillmentStatus?: string | null; - receiptUrl?: string | null; - processedAt?: DateString | null; - chargeId?: string | null; -} -``` -### Return Type -Recall that executing the `UpdateOrderByChargeId` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `UpdateOrderByChargeIdData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface UpdateOrderByChargeIdData { - order_update?: Order_Key | null; -} -``` -### Using `UpdateOrderByChargeId`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, updateOrderByChargeId, UpdateOrderByChargeIdVariables } from '@firebasegen/default-connector'; - -// The `UpdateOrderByChargeId` mutation has an optional argument of type `UpdateOrderByChargeIdVariables`: -const updateOrderByChargeIdVars: UpdateOrderByChargeIdVariables = { - financialStatus: ..., // optional - fulfillmentStatus: ..., // optional - receiptUrl: ..., // optional - processedAt: ..., // optional - chargeId: ..., // optional -}; - -// Call the `updateOrderByChargeId()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await updateOrderByChargeId(updateOrderByChargeIdVars); -// Variables can be defined inline as well. -const { data } = await updateOrderByChargeId({ financialStatus: ..., fulfillmentStatus: ..., receiptUrl: ..., processedAt: ..., chargeId: ..., }); -// Since all variables are optional for this mutation, you can omit the `UpdateOrderByChargeIdVariables` argument. -const { data } = await updateOrderByChargeId(); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await updateOrderByChargeId(dataConnect, updateOrderByChargeIdVars); - -console.log(data.order_update); - -// Or, you can use the `Promise` API. -updateOrderByChargeId(updateOrderByChargeIdVars).then((response) => { - const data = response.data; - console.log(data.order_update); -}); -``` - -### Using `UpdateOrderByChargeId`'s `MutationRef` function - -```javascript -import { getDataConnect, DataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, updateOrderByChargeIdRef, UpdateOrderByChargeIdVariables } from '@firebasegen/default-connector'; - -// The `UpdateOrderByChargeId` mutation has an optional argument of type `UpdateOrderByChargeIdVariables`: -const updateOrderByChargeIdVars: UpdateOrderByChargeIdVariables = { - financialStatus: ..., // optional - fulfillmentStatus: ..., // optional - receiptUrl: ..., // optional - processedAt: ..., // optional - chargeId: ..., // optional -}; - -// Call the `updateOrderByChargeIdRef()` function to get a reference to the mutation. -const ref = updateOrderByChargeIdRef(updateOrderByChargeIdVars); -// Variables can be defined inline as well. -const ref = updateOrderByChargeIdRef({ financialStatus: ..., fulfillmentStatus: ..., receiptUrl: ..., processedAt: ..., chargeId: ..., }); -// Since all variables are optional for this mutation, you can omit the `UpdateOrderByChargeIdVariables` argument. -const ref = updateOrderByChargeIdRef(); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = updateOrderByChargeIdRef(dataConnect, updateOrderByChargeIdVars); - -// Call `executeMutation()` on the reference to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeMutation(ref); - -console.log(data.order_update); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.order_update); -}); -``` - -## CreateOrderItem -You can execute the `CreateOrderItem` mutation using the following action shortcut function, or by calling `executeMutation()` after calling the following `MutationRef` function, both of which are defined in [default-connector/index.d.ts](./index.d.ts): -```javascript -createOrderItem(vars: CreateOrderItemVariables): MutationPromise; - -createOrderItemRef(vars: CreateOrderItemVariables): MutationRef; -``` -You can also pass in a `DataConnect` instance to the action shortcut function or `MutationRef` function. -```javascript -createOrderItem(dc: DataConnect, vars: CreateOrderItemVariables): MutationPromise; - -createOrderItemRef(dc: DataConnect, vars: CreateOrderItemVariables): MutationRef; -``` - -### Variables -The `CreateOrderItem` mutation requires an argument of type `CreateOrderItemVariables`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: - -```javascript -export interface CreateOrderItemVariables { - orderId: UUIDString; - productId: UUIDString; - quantity: number; - price: number; -} -``` -### Return Type -Recall that executing the `CreateOrderItem` mutation returns a `MutationPromise` that resolves to an object with a `data` property. - -The `data` property is an object of type `CreateOrderItemData`, which is defined in [default-connector/index.d.ts](./index.d.ts). It has the following fields: -```javascript -export interface CreateOrderItemData { - orderItem_insert: OrderItem_Key; -} -``` -### Using `CreateOrderItem`'s action shortcut function - -```javascript -import { getDataConnect, DataConnect } from 'firebase/data-connect'; -import { connectorConfig, createOrderItem, CreateOrderItemVariables } from '@firebasegen/default-connector'; - -// The `CreateOrderItem` mutation requires an argument of type `CreateOrderItemVariables`: -const createOrderItemVars: CreateOrderItemVariables = { - orderId: ..., - productId: ..., - quantity: ..., - price: ..., -}; - -// Call the `createOrderItem()` function to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await createOrderItem(createOrderItemVars); -// Variables can be defined inline as well. -const { data } = await createOrderItem({ orderId: ..., productId: ..., quantity: ..., price: ..., }); - -// You can also pass in a `DataConnect` instance to the action shortcut function. -const dataConnect = getDataConnect(connectorConfig); -const { data } = await createOrderItem(dataConnect, createOrderItemVars); - -console.log(data.orderItem_insert); - -// Or, you can use the `Promise` API. -createOrderItem(createOrderItemVars).then((response) => { - const data = response.data; - console.log(data.orderItem_insert); -}); -``` - -### Using `CreateOrderItem`'s `MutationRef` function - -```javascript -import { getDataConnect, DataConnect, executeMutation } from 'firebase/data-connect'; -import { connectorConfig, createOrderItemRef, CreateOrderItemVariables } from '@firebasegen/default-connector'; - -// The `CreateOrderItem` mutation requires an argument of type `CreateOrderItemVariables`: -const createOrderItemVars: CreateOrderItemVariables = { - orderId: ..., - productId: ..., - quantity: ..., - price: ..., -}; - -// Call the `createOrderItemRef()` function to get a reference to the mutation. -const ref = createOrderItemRef(createOrderItemVars); -// Variables can be defined inline as well. -const ref = createOrderItemRef({ orderId: ..., productId: ..., quantity: ..., price: ..., }); - -// You can also pass in a `DataConnect` instance to the `MutationRef` function. -const dataConnect = getDataConnect(connectorConfig); -const ref = createOrderItemRef(dataConnect, createOrderItemVars); - -// Call `executeMutation()` on the reference to execute the mutation. -// You can use the `await` keyword to wait for the promise to resolve. -const { data } = await executeMutation(ref); - -console.log(data.orderItem_insert); - -// Or, you can use the `Promise` API. -executeMutation(ref).then((response) => { - const data = response.data; - console.log(data.orderItem_insert); -}); -``` - diff --git a/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/esm/index.esm.js b/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/esm/index.esm.js deleted file mode 100644 index 0762e9ca..00000000 --- a/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/esm/index.esm.js +++ /dev/null @@ -1,178 +0,0 @@ -import { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } from 'firebase/data-connect'; - -export const connectorConfig = { - connector: 'default', - service: 'firebase-ecommerce', - location: 'us-central1' -}; - -export function upsertCustomerRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpsertCustomer', inputVars); -} - -export function upsertCustomer(dcOrVars, vars) { - return executeMutation(upsertCustomerRef(dcOrVars, vars)); -} - -export function createProductReviewRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateProductReview', inputVars); -} - -export function createProductReview(dcOrVars, vars) { - return executeMutation(createProductReviewRef(dcOrVars, vars)); -} - -export function createOrderRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateOrder', inputVars); -} - -export function createOrder(dcOrVars, vars) { - return executeMutation(createOrderRef(dcOrVars, vars)); -} - -export function updateOrderByPaymentIntentIdRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateOrderByPaymentIntentId', inputVars); -} - -export function updateOrderByPaymentIntentId(dcOrVars, vars) { - return executeMutation(updateOrderByPaymentIntentIdRef(dcOrVars, vars)); -} - -export function updateOrderByChargeIdRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateOrderByChargeId', inputVars); -} - -export function updateOrderByChargeId(dcOrVars, vars) { - return executeMutation(updateOrderByChargeIdRef(dcOrVars, vars)); -} - -export function createOrderItemRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateOrderItem', inputVars); -} - -export function createOrderItem(dcOrVars, vars) { - return executeMutation(createOrderItemRef(dcOrVars, vars)); -} - -export function listCustomersRef(dc) { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'ListCustomers'); -} - -export function listCustomers(dc) { - return executeQuery(listCustomersRef(dc)); -} - -export function getReviewsByHandleRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetReviewsByHandle', inputVars); -} - -export function getReviewsByHandle(dcOrVars, vars) { - return executeQuery(getReviewsByHandleRef(dcOrVars, vars)); -} - -export function getProductByHandleRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetProductByHandle', inputVars); -} - -export function getProductByHandle(dcOrVars, vars) { - return executeQuery(getProductByHandleRef(dcOrVars, vars)); -} - -export function getCollectionByHandleRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetCollectionByHandle', inputVars); -} - -export function getCollectionByHandle(dcOrVars, vars) { - return executeQuery(getCollectionByHandleRef(dcOrVars, vars)); -} - -export function getCollectionsByPageRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetCollectionsByPage', inputVars); -} - -export function getCollectionsByPage(dcOrVars, vars) { - return executeQuery(getCollectionsByPageRef(dcOrVars, vars)); -} - -export function searchProductDescriptionUsingL2similarityRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'SearchProductDescriptionUsingL2Similarity', inputVars); -} - -export function searchProductDescriptionUsingL2similarity(dcOrVars, vars) { - return executeQuery(searchProductDescriptionUsingL2similarityRef(dcOrVars, vars)); -} - -export function searchProductTitleUsingL2similarityRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'SearchProductTitleUsingL2Similarity', inputVars); -} - -export function searchProductTitleUsingL2similarity(dcOrVars, vars) { - return executeQuery(searchProductTitleUsingL2similarityRef(dcOrVars, vars)); -} - -export function searchProductReviewContentUsingL2similarityRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'SearchProductReviewContentUsingL2Similarity', inputVars); -} - -export function searchProductReviewContentUsingL2similarity(dcOrVars, vars) { - return executeQuery(searchProductReviewContentUsingL2similarityRef(dcOrVars, vars)); -} - -export function getOrdersByCustomerIdRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetOrdersByCustomerId', inputVars); -} - -export function getOrdersByCustomerId(dcOrVars, vars) { - return executeQuery(getOrdersByCustomerIdRef(dcOrVars, vars)); -} - -export function getCurrentCustomerOrdersRef(dc) { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetCurrentCustomerOrders'); -} - -export function getCurrentCustomerOrders(dc) { - return executeQuery(getCurrentCustomerOrdersRef(dc)); -} - -export function getOrderByIdRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetOrderById', inputVars); -} - -export function getOrderById(dcOrVars, vars) { - return executeQuery(getOrderByIdRef(dcOrVars, vars)); -} - diff --git a/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/esm/package.json b/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/esm/package.json deleted file mode 100644 index 7c34deb5..00000000 --- a/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"module"} \ No newline at end of file diff --git a/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/index.cjs.js b/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/index.cjs.js deleted file mode 100644 index beeb0882..00000000 --- a/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/index.cjs.js +++ /dev/null @@ -1,145 +0,0 @@ -const { queryRef, executeQuery, mutationRef, executeMutation, validateArgs } = require('firebase/data-connect'); - -const connectorConfig = { - connector: 'default', - service: 'firebase-ecommerce', - location: 'us-central1' -}; -exports.connectorConfig = connectorConfig; - -exports.upsertCustomerRef = function upsertCustomerRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpsertCustomer', inputVars); -} -exports.upsertCustomer = function upsertCustomer(dcOrVars, vars) { - return executeMutation(upsertCustomerRef(dcOrVars, vars)); -}; -exports.createProductReviewRef = function createProductReviewRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateProductReview', inputVars); -} -exports.createProductReview = function createProductReview(dcOrVars, vars) { - return executeMutation(createProductReviewRef(dcOrVars, vars)); -}; -exports.createOrderRef = function createOrderRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateOrder', inputVars); -} -exports.createOrder = function createOrder(dcOrVars, vars) { - return executeMutation(createOrderRef(dcOrVars, vars)); -}; -exports.updateOrderByPaymentIntentIdRef = function updateOrderByPaymentIntentIdRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateOrderByPaymentIntentId', inputVars); -} -exports.updateOrderByPaymentIntentId = function updateOrderByPaymentIntentId(dcOrVars, vars) { - return executeMutation(updateOrderByPaymentIntentIdRef(dcOrVars, vars)); -}; -exports.updateOrderByChargeIdRef = function updateOrderByChargeIdRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'UpdateOrderByChargeId', inputVars); -} -exports.updateOrderByChargeId = function updateOrderByChargeId(dcOrVars, vars) { - return executeMutation(updateOrderByChargeIdRef(dcOrVars, vars)); -}; -exports.createOrderItemRef = function createOrderItemRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return mutationRef(dcInstance, 'CreateOrderItem', inputVars); -} -exports.createOrderItem = function createOrderItem(dcOrVars, vars) { - return executeMutation(createOrderItemRef(dcOrVars, vars)); -}; -exports.listCustomersRef = function listCustomersRef(dc) { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'ListCustomers'); -} -exports.listCustomers = function listCustomers(dc) { - return executeQuery(listCustomersRef(dc)); -}; -exports.getReviewsByHandleRef = function getReviewsByHandleRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetReviewsByHandle', inputVars); -} -exports.getReviewsByHandle = function getReviewsByHandle(dcOrVars, vars) { - return executeQuery(getReviewsByHandleRef(dcOrVars, vars)); -}; -exports.getProductByHandleRef = function getProductByHandleRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetProductByHandle', inputVars); -} -exports.getProductByHandle = function getProductByHandle(dcOrVars, vars) { - return executeQuery(getProductByHandleRef(dcOrVars, vars)); -}; -exports.getCollectionByHandleRef = function getCollectionByHandleRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetCollectionByHandle', inputVars); -} -exports.getCollectionByHandle = function getCollectionByHandle(dcOrVars, vars) { - return executeQuery(getCollectionByHandleRef(dcOrVars, vars)); -}; -exports.getCollectionsByPageRef = function getCollectionsByPageRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetCollectionsByPage', inputVars); -} -exports.getCollectionsByPage = function getCollectionsByPage(dcOrVars, vars) { - return executeQuery(getCollectionsByPageRef(dcOrVars, vars)); -}; -exports.searchProductDescriptionUsingL2similarityRef = function searchProductDescriptionUsingL2similarityRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'SearchProductDescriptionUsingL2Similarity', inputVars); -} -exports.searchProductDescriptionUsingL2similarity = function searchProductDescriptionUsingL2similarity(dcOrVars, vars) { - return executeQuery(searchProductDescriptionUsingL2similarityRef(dcOrVars, vars)); -}; -exports.searchProductTitleUsingL2similarityRef = function searchProductTitleUsingL2similarityRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'SearchProductTitleUsingL2Similarity', inputVars); -} -exports.searchProductTitleUsingL2similarity = function searchProductTitleUsingL2similarity(dcOrVars, vars) { - return executeQuery(searchProductTitleUsingL2similarityRef(dcOrVars, vars)); -}; -exports.searchProductReviewContentUsingL2similarityRef = function searchProductReviewContentUsingL2similarityRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'SearchProductReviewContentUsingL2Similarity', inputVars); -} -exports.searchProductReviewContentUsingL2similarity = function searchProductReviewContentUsingL2similarity(dcOrVars, vars) { - return executeQuery(searchProductReviewContentUsingL2similarityRef(dcOrVars, vars)); -}; -exports.getOrdersByCustomerIdRef = function getOrdersByCustomerIdRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetOrdersByCustomerId', inputVars); -} -exports.getOrdersByCustomerId = function getOrdersByCustomerId(dcOrVars, vars) { - return executeQuery(getOrdersByCustomerIdRef(dcOrVars, vars)); -}; -exports.getCurrentCustomerOrdersRef = function getCurrentCustomerOrdersRef(dc) { - const { dc: dcInstance} = validateArgs(connectorConfig, dc, undefined); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetCurrentCustomerOrders'); -} -exports.getCurrentCustomerOrders = function getCurrentCustomerOrders(dc) { - return executeQuery(getCurrentCustomerOrdersRef(dc)); -}; -exports.getOrderByIdRef = function getOrderByIdRef(dcOrVars, vars) { - const { dc: dcInstance, vars: inputVars} = validateArgs(connectorConfig, dcOrVars, vars, true); - dcInstance._useGeneratedSdk(); - return queryRef(dcInstance, 'GetOrderById', inputVars); -} -exports.getOrderById = function getOrderById(dcOrVars, vars) { - return executeQuery(getOrderByIdRef(dcOrVars, vars)); -}; diff --git a/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/index.d.ts b/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/index.d.ts deleted file mode 100644 index 029fb637..00000000 --- a/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/index.d.ts +++ /dev/null @@ -1,588 +0,0 @@ -import { ConnectorConfig, DataConnect, QueryRef, QueryPromise, MutationRef, MutationPromise } from 'firebase/data-connect'; - -export const connectorConfig: ConnectorConfig; - -export type TimestampString = string; -export type UUIDString = string; -export type Int64String = string; -export type DateString = string; - - -export interface Collection_Key { - id: UUIDString; - __typename?: 'Collection_Key'; -} - -export interface CreateOrderData { - order_insert: Order_Key; -} - -export interface CreateOrderItemData { - orderItem_insert: OrderItem_Key; -} - -export interface CreateOrderItemVariables { - orderId: UUIDString; - productId: UUIDString; - quantity: number; - price: number; -} - -export interface CreateOrderVariables { - customerId: string; - chargeId?: string | null; - paymentIntentId?: string | null; - receiptUrl?: string | null; - subtotalPrice: number; - totalTax: number; - totalShippingPrice: number; - totalPrice: number; - financialStatus: string; - fulfillmentStatus: string; -} - -export interface CreateProductReviewData { - productReview_insert: ProductReview_Key; -} - -export interface CreateProductReviewVariables { - productId: UUIDString; - rating: number; - content: string; -} - -export interface Customer_Key { - id: string; - __typename?: 'Customer_Key'; -} - -export interface GetCollectionByHandleData { - collections: ({ - id: UUIDString; - name: string; - description?: string | null; - page?: string | null; - featuredImage?: { - url: string; - width: number; - height: number; - altText?: string | null; - }; - seo?: { - title: string; - description: string; - keywords: string; - }; - products_via_ProductCollection: ({ - id: UUIDString; - title: string; - handle: string; - description?: string | null; - availableForSale: boolean; - createdAt: DateString; - updatedAt: DateString; - productVariants_on_product: ({ - id: UUIDString; - price: number; - availableForSale: boolean; - inventoryQuantity: number; - selectedOptions_on_productVariant: ({ - name?: string | null; - value?: string | null; - })[]; - } & ProductVariant_Key)[]; - productImages_on_product: ({ - id: UUIDString; - url: string; - altText?: string | null; - width: number; - height: number; - displayPosition: number; - } & ProductImage_Key)[]; - } & Product_Key)[]; - } & Collection_Key)[]; -} - -export interface GetCollectionByHandleVariables { - handle: string; - page?: string | null; -} - -export interface GetCollectionsByPageData { - collections: ({ - id: UUIDString; - name: string; - description?: string | null; - handle: string; - page?: string | null; - featuredImage?: { - url: string; - width: number; - height: number; - altText?: string | null; - }; - products_via_ProductCollection: ({ - id: UUIDString; - title: string; - handle: string; - description?: string | null; - productVariants_on_product: ({ - id: UUIDString; - price: number; - selectedOptions_on_productVariant: ({ - name?: string | null; - value?: string | null; - })[]; - } & ProductVariant_Key)[]; - productImages_on_product: ({ - id: UUIDString; - url: string; - altText?: string | null; - width: number; - height: number; - displayPosition: number; - } & ProductImage_Key)[]; - } & Product_Key)[]; - } & Collection_Key)[]; -} - -export interface GetCollectionsByPageVariables { - page?: string | null; -} - -export interface GetCurrentCustomerOrdersData { - orders?: { - orders_on_customer: ({ - id: UUIDString; - processedAt: DateString; - chargeId?: string | null; - paymentIntentId?: string | null; - receiptUrl?: string | null; - subtotalPrice: number; - totalPrice: number; - financialStatus: string; - fulfillmentStatus: string; - orderItems_on_order: ({ - id: UUIDString; - quantity: number; - price: number; - product: { - id: UUIDString; - title: string; - handle: string; - productImages_on_product: ({ - url: string; - altText?: string | null; - width: number; - height: number; - })[]; - } & Product_Key; - } & OrderItem_Key)[]; - } & Order_Key)[]; - }; -} - -export interface GetOrderByIdData { - order?: { - id: UUIDString; - customerId: string; - processedAt: DateString; - receiptUrl?: string | null; - totalPrice: number; - financialStatus: string; - fulfillmentStatus: string; - orderItems_on_order: ({ - id: UUIDString; - quantity: number; - price: number; - product: { - id: UUIDString; - title: string; - handle: string; - productImages_on_product: ({ - url: string; - altText?: string | null; - width: number; - height: number; - })[]; - } & Product_Key; - } & OrderItem_Key)[]; - } & Order_Key; -} - -export interface GetOrderByIdVariables { - id: UUIDString; -} - -export interface GetOrdersByCustomerIdData { - orders: ({ - id: UUIDString; - customerId: string; - processedAt: DateString; - chargeId?: string | null; - paymentIntentId?: string | null; - receiptUrl?: string | null; - subtotalPrice: number; - totalPrice: number; - financialStatus: string; - fulfillmentStatus: string; - orderItems_on_order: ({ - id: UUIDString; - quantity: number; - price: number; - product: { - id: UUIDString; - title: string; - handle: string; - productImages_on_product: ({ - url: string; - altText?: string | null; - width: number; - height: number; - })[]; - } & Product_Key; - } & OrderItem_Key)[]; - } & Order_Key)[]; -} - -export interface GetOrdersByCustomerIdVariables { - customerId: string; -} - -export interface GetProductByHandleData { - product?: { - id: UUIDString; - title: string; - description?: string | null; - handle: string; - availableForSale: boolean; - createdAt: DateString; - updatedAt: DateString; - featuredImage?: { - url: string; - width: number; - height: number; - altText?: string | null; - }; - seo?: { - title: string; - description: string; - keywords: string; - }; - productVariants_on_product: ({ - id: UUIDString; - price: number; - availableForSale: boolean; - inventoryQuantity: number; - selectedOptions_on_productVariant: ({ - name?: string | null; - value?: string | null; - })[]; - } & ProductVariant_Key)[]; - productImages_on_product: ({ - id: UUIDString; - url: string; - altText?: string | null; - width: number; - height: number; - displayPosition: number; - } & ProductImage_Key)[]; - } & Product_Key; -} - -export interface GetProductByHandleVariables { - handle: string; -} - -export interface GetReviewsByHandleData { - products: ({ - productReviews_on_product: ({ - id: UUIDString; - rating: number; - content: string; - date: DateString; - customer: { - id: string; - firstName: string; - lastName: string; - } & Customer_Key; - })[]; - })[]; -} - -export interface GetReviewsByHandleVariables { - handle: string; -} - -export interface ListCustomersData { - customers: ({ - id: string; - firstName: string; - lastName: string; - email: string; - } & Customer_Key)[]; -} - -export interface OrderItem_Key { - id: UUIDString; - __typename?: 'OrderItem_Key'; -} - -export interface Order_Key { - id: UUIDString; - __typename?: 'Order_Key'; -} - -export interface ProductCollection_Key { - collectionId: UUIDString; - productId: UUIDString; - __typename?: 'ProductCollection_Key'; -} - -export interface ProductImage_Key { - id: UUIDString; - __typename?: 'ProductImage_Key'; -} - -export interface ProductOption_Key { - id: UUIDString; - __typename?: 'ProductOption_Key'; -} - -export interface ProductReview_Key { - productId: UUIDString; - customerId: string; - __typename?: 'ProductReview_Key'; -} - -export interface ProductVariant_Key { - id: UUIDString; - __typename?: 'ProductVariant_Key'; -} - -export interface Product_Key { - id: UUIDString; - __typename?: 'Product_Key'; -} - -export interface SEO_Key { - id: UUIDString; - __typename?: 'SEO_Key'; -} - -export interface SearchProductDescriptionUsingL2similarityData { - products_descriptionEmbedding_similarity: ({ - id: UUIDString; - handle: string; - title: string; - } & Product_Key)[]; -} - -export interface SearchProductDescriptionUsingL2similarityVariables { - query: string; -} - -export interface SearchProductReviewContentUsingL2similarityData { - productReviews_contentEmbedding_similarity: ({ - product: { - id: UUIDString; - title: string; - handle: string; - } & Product_Key; - })[]; -} - -export interface SearchProductReviewContentUsingL2similarityVariables { - query: string; -} - -export interface SearchProductTitleUsingL2similarityData { - products_titleEmbedding_similarity: ({ - id: UUIDString; - handle: string; - title: string; - } & Product_Key)[]; -} - -export interface SearchProductTitleUsingL2similarityVariables { - query: string; -} - -export interface SelectedOption_Key { - id: UUIDString; - __typename?: 'SelectedOption_Key'; -} - -export interface UpdateOrderByChargeIdData { - order_update?: Order_Key | null; -} - -export interface UpdateOrderByChargeIdVariables { - financialStatus?: string | null; - fulfillmentStatus?: string | null; - receiptUrl?: string | null; - processedAt?: DateString | null; - chargeId?: string | null; -} - -export interface UpdateOrderByPaymentIntentIdData { - order_update?: Order_Key | null; -} - -export interface UpdateOrderByPaymentIntentIdVariables { - paymentIntentId: string; - financialStatus?: string | null; - fulfillmentStatus?: string | null; - receiptUrl?: string | null; - processedAt?: DateString | null; - chargeId?: string | null; -} - -export interface UpsertCustomerData { - customer_upsert: Customer_Key; -} - -export interface UpsertCustomerVariables { - firstName: string; - lastName: string; - email: string; - phone: string; - acceptsMarketing: boolean; -} - -/* Allow users to create refs without passing in DataConnect */ -export function upsertCustomerRef(vars: UpsertCustomerVariables): MutationRef; -/* Allow users to pass in custom DataConnect instances */ -export function upsertCustomerRef(dc: DataConnect, vars: UpsertCustomerVariables): MutationRef; - -export function upsertCustomer(vars: UpsertCustomerVariables): MutationPromise; -export function upsertCustomer(dc: DataConnect, vars: UpsertCustomerVariables): MutationPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function createProductReviewRef(vars: CreateProductReviewVariables): MutationRef; -/* Allow users to pass in custom DataConnect instances */ -export function createProductReviewRef(dc: DataConnect, vars: CreateProductReviewVariables): MutationRef; - -export function createProductReview(vars: CreateProductReviewVariables): MutationPromise; -export function createProductReview(dc: DataConnect, vars: CreateProductReviewVariables): MutationPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function createOrderRef(vars: CreateOrderVariables): MutationRef; -/* Allow users to pass in custom DataConnect instances */ -export function createOrderRef(dc: DataConnect, vars: CreateOrderVariables): MutationRef; - -export function createOrder(vars: CreateOrderVariables): MutationPromise; -export function createOrder(dc: DataConnect, vars: CreateOrderVariables): MutationPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function updateOrderByPaymentIntentIdRef(vars: UpdateOrderByPaymentIntentIdVariables): MutationRef; -/* Allow users to pass in custom DataConnect instances */ -export function updateOrderByPaymentIntentIdRef(dc: DataConnect, vars: UpdateOrderByPaymentIntentIdVariables): MutationRef; - -export function updateOrderByPaymentIntentId(vars: UpdateOrderByPaymentIntentIdVariables): MutationPromise; -export function updateOrderByPaymentIntentId(dc: DataConnect, vars: UpdateOrderByPaymentIntentIdVariables): MutationPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function updateOrderByChargeIdRef(vars?: UpdateOrderByChargeIdVariables): MutationRef; -/* Allow users to pass in custom DataConnect instances */ -export function updateOrderByChargeIdRef(dc: DataConnect, vars?: UpdateOrderByChargeIdVariables): MutationRef; - -export function updateOrderByChargeId(vars?: UpdateOrderByChargeIdVariables): MutationPromise; -export function updateOrderByChargeId(dc: DataConnect, vars?: UpdateOrderByChargeIdVariables): MutationPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function createOrderItemRef(vars: CreateOrderItemVariables): MutationRef; -/* Allow users to pass in custom DataConnect instances */ -export function createOrderItemRef(dc: DataConnect, vars: CreateOrderItemVariables): MutationRef; - -export function createOrderItem(vars: CreateOrderItemVariables): MutationPromise; -export function createOrderItem(dc: DataConnect, vars: CreateOrderItemVariables): MutationPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function listCustomersRef(): QueryRef; -/* Allow users to pass in custom DataConnect instances */ -export function listCustomersRef(dc: DataConnect): QueryRef; - -export function listCustomers(): QueryPromise; -export function listCustomers(dc: DataConnect): QueryPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function getReviewsByHandleRef(vars: GetReviewsByHandleVariables): QueryRef; -/* Allow users to pass in custom DataConnect instances */ -export function getReviewsByHandleRef(dc: DataConnect, vars: GetReviewsByHandleVariables): QueryRef; - -export function getReviewsByHandle(vars: GetReviewsByHandleVariables): QueryPromise; -export function getReviewsByHandle(dc: DataConnect, vars: GetReviewsByHandleVariables): QueryPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function getProductByHandleRef(vars: GetProductByHandleVariables): QueryRef; -/* Allow users to pass in custom DataConnect instances */ -export function getProductByHandleRef(dc: DataConnect, vars: GetProductByHandleVariables): QueryRef; - -export function getProductByHandle(vars: GetProductByHandleVariables): QueryPromise; -export function getProductByHandle(dc: DataConnect, vars: GetProductByHandleVariables): QueryPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function getCollectionByHandleRef(vars: GetCollectionByHandleVariables): QueryRef; -/* Allow users to pass in custom DataConnect instances */ -export function getCollectionByHandleRef(dc: DataConnect, vars: GetCollectionByHandleVariables): QueryRef; - -export function getCollectionByHandle(vars: GetCollectionByHandleVariables): QueryPromise; -export function getCollectionByHandle(dc: DataConnect, vars: GetCollectionByHandleVariables): QueryPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function getCollectionsByPageRef(vars?: GetCollectionsByPageVariables): QueryRef; -/* Allow users to pass in custom DataConnect instances */ -export function getCollectionsByPageRef(dc: DataConnect, vars?: GetCollectionsByPageVariables): QueryRef; - -export function getCollectionsByPage(vars?: GetCollectionsByPageVariables): QueryPromise; -export function getCollectionsByPage(dc: DataConnect, vars?: GetCollectionsByPageVariables): QueryPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function searchProductDescriptionUsingL2similarityRef(vars: SearchProductDescriptionUsingL2similarityVariables): QueryRef; -/* Allow users to pass in custom DataConnect instances */ -export function searchProductDescriptionUsingL2similarityRef(dc: DataConnect, vars: SearchProductDescriptionUsingL2similarityVariables): QueryRef; - -export function searchProductDescriptionUsingL2similarity(vars: SearchProductDescriptionUsingL2similarityVariables): QueryPromise; -export function searchProductDescriptionUsingL2similarity(dc: DataConnect, vars: SearchProductDescriptionUsingL2similarityVariables): QueryPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function searchProductTitleUsingL2similarityRef(vars: SearchProductTitleUsingL2similarityVariables): QueryRef; -/* Allow users to pass in custom DataConnect instances */ -export function searchProductTitleUsingL2similarityRef(dc: DataConnect, vars: SearchProductTitleUsingL2similarityVariables): QueryRef; - -export function searchProductTitleUsingL2similarity(vars: SearchProductTitleUsingL2similarityVariables): QueryPromise; -export function searchProductTitleUsingL2similarity(dc: DataConnect, vars: SearchProductTitleUsingL2similarityVariables): QueryPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function searchProductReviewContentUsingL2similarityRef(vars: SearchProductReviewContentUsingL2similarityVariables): QueryRef; -/* Allow users to pass in custom DataConnect instances */ -export function searchProductReviewContentUsingL2similarityRef(dc: DataConnect, vars: SearchProductReviewContentUsingL2similarityVariables): QueryRef; - -export function searchProductReviewContentUsingL2similarity(vars: SearchProductReviewContentUsingL2similarityVariables): QueryPromise; -export function searchProductReviewContentUsingL2similarity(dc: DataConnect, vars: SearchProductReviewContentUsingL2similarityVariables): QueryPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function getOrdersByCustomerIdRef(vars: GetOrdersByCustomerIdVariables): QueryRef; -/* Allow users to pass in custom DataConnect instances */ -export function getOrdersByCustomerIdRef(dc: DataConnect, vars: GetOrdersByCustomerIdVariables): QueryRef; - -export function getOrdersByCustomerId(vars: GetOrdersByCustomerIdVariables): QueryPromise; -export function getOrdersByCustomerId(dc: DataConnect, vars: GetOrdersByCustomerIdVariables): QueryPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function getCurrentCustomerOrdersRef(): QueryRef; -/* Allow users to pass in custom DataConnect instances */ -export function getCurrentCustomerOrdersRef(dc: DataConnect): QueryRef; - -export function getCurrentCustomerOrders(): QueryPromise; -export function getCurrentCustomerOrders(dc: DataConnect): QueryPromise; - -/* Allow users to create refs without passing in DataConnect */ -export function getOrderByIdRef(vars: GetOrderByIdVariables): QueryRef; -/* Allow users to pass in custom DataConnect instances */ -export function getOrderByIdRef(dc: DataConnect, vars: GetOrderByIdVariables): QueryRef; - -export function getOrderById(vars: GetOrderByIdVariables): QueryPromise; -export function getOrderById(dc: DataConnect, vars: GetOrderByIdVariables): QueryPromise; - diff --git a/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/package.json b/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/package.json deleted file mode 100644 index d0c9852c..00000000 --- a/starters/nextjs/firebase-ecommerce/dataconnect-generated/js/default-connector/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@firebasegen/default-connector", - "version": "1.0.0", - "author": "Firebase (https://firebase.google.com/)", - "description": "Generated SDK For default", - "license": "Apache-2.0", - "engines": { - "node": " >=18.0" - }, - "typings": "index.d.ts", - "module": "esm/index.esm.js", - "main": "index.cjs.js", - "browser": "esm/index.esm.js", - "exports": { - ".": { - "types": "./index.d.ts", - "require": "./index.cjs.js", - "default": "./esm/index.esm.js" - }, - "./package.json": "./package.json" - }, - "peerDependencies": { - "firebase": "^10.14.0 || ^11.3.0" - } -} \ No newline at end of file diff --git a/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/implicit.gql b/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/implicit.gql deleted file mode 100644 index e19e0fbb..00000000 --- a/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/implicit.gql +++ /dev/null @@ -1,80 +0,0 @@ -extend type Collection { - """ - ✨ Implicit foreign key field based on `Collection`.`featuredImage`. It must match the value of `ProductImage`.`id`. See `@ref` for how to customize it. - """ - featuredImageId: UUID @fdc_generated(from: "Collection.featuredImage", purpose: IMPLICIT_REF_FIELD) - """ - ✨ Implicit foreign key field based on `Collection`.`seo`. It must match the value of `SEO`.`id`. See `@ref` for how to customize it. - """ - seoId: UUID @fdc_generated(from: "Collection.seo", purpose: IMPLICIT_REF_FIELD) -} -extend type Order { - """ - ✨ Implicit foreign key field based on `Order`.`customer`. It must match the value of `Customer`.`id`. See `@ref` for how to customize it. - """ - customerId: String! @fdc_generated(from: "Order.customer", purpose: IMPLICIT_REF_FIELD) -} -extend type OrderItem { - """ - ✨ Implicit foreign key field based on `OrderItem`.`order`. It must match the value of `Order`.`id`. See `@ref` for how to customize it. - """ - orderId: UUID! @fdc_generated(from: "OrderItem.order", purpose: IMPLICIT_REF_FIELD) - """ - ✨ Implicit foreign key field based on `OrderItem`.`product`. It must match the value of `Product`.`id`. See `@ref` for how to customize it. - """ - productId: UUID! @fdc_generated(from: "OrderItem.product", purpose: IMPLICIT_REF_FIELD) -} -extend type Product { - """ - ✨ Implicit foreign key field based on `Product`.`featuredImage`. It must match the value of `ProductImage`.`id`. See `@ref` for how to customize it. - """ - featuredImageId: UUID @fdc_generated(from: "Product.featuredImage", purpose: IMPLICIT_REF_FIELD) - """ - ✨ Implicit foreign key field based on `Product`.`seo`. It must match the value of `SEO`.`id`. See `@ref` for how to customize it. - """ - seoId: UUID @fdc_generated(from: "Product.seo", purpose: IMPLICIT_REF_FIELD) -} -extend type ProductCollection { - """ - ✨ Implicit foreign key field based on `ProductCollection`.`collection`. It must match the value of `Collection`.`id`. See `@ref` for how to customize it. - """ - collectionId: UUID! @fdc_generated(from: "ProductCollection.collection", purpose: IMPLICIT_REF_FIELD) - """ - ✨ Implicit foreign key field based on `ProductCollection`.`product`. It must match the value of `Product`.`id`. See `@ref` for how to customize it. - """ - productId: UUID! @fdc_generated(from: "ProductCollection.product", purpose: IMPLICIT_REF_FIELD) -} -extend type ProductImage { - """ - ✨ Implicit foreign key field based on `ProductImage`.`product`. It must match the value of `Product`.`id`. See `@ref` for how to customize it. - """ - productId: UUID! @fdc_generated(from: "ProductImage.product", purpose: IMPLICIT_REF_FIELD) -} -extend type ProductOption { - """ - ✨ Implicit foreign key field based on `ProductOption`.`product`. It must match the value of `Product`.`id`. See `@ref` for how to customize it. - """ - productId: UUID! @fdc_generated(from: "ProductOption.product", purpose: IMPLICIT_REF_FIELD) -} -extend type ProductReview { - """ - ✨ Implicit foreign key field based on `ProductReview`.`product`. It must match the value of `Product`.`id`. See `@ref` for how to customize it. - """ - productId: UUID! @fdc_generated(from: "ProductReview.product", purpose: IMPLICIT_REF_FIELD) - """ - ✨ Implicit foreign key field based on `ProductReview`.`customer`. It must match the value of `Customer`.`id`. See `@ref` for how to customize it. - """ - customerId: String! @fdc_generated(from: "ProductReview.customer", purpose: IMPLICIT_REF_FIELD) -} -extend type ProductVariant { - """ - ✨ Implicit foreign key field based on `ProductVariant`.`product`. It must match the value of `Product`.`id`. See `@ref` for how to customize it. - """ - productId: UUID! @fdc_generated(from: "ProductVariant.product", purpose: IMPLICIT_REF_FIELD) -} -extend type SelectedOption { - """ - ✨ Implicit foreign key field based on `SelectedOption`.`productVariant`. It must match the value of `ProductVariant`.`id`. See `@ref` for how to customize it. - """ - productVariantId: UUID! @fdc_generated(from: "SelectedOption.productVariant", purpose: IMPLICIT_REF_FIELD) -} diff --git a/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/input.gql b/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/input.gql deleted file mode 100644 index 3275e7b7..00000000 --- a/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/input.gql +++ /dev/null @@ -1,2408 +0,0 @@ -""" -✨ `Collection_KeyOutput` returns the primary key fields of table type `Collection`. - -It has the same format as `Collection_Key`, but is only used as mutation return value. -""" -scalar Collection_KeyOutput -""" -✨ `Customer_KeyOutput` returns the primary key fields of table type `Customer`. - -It has the same format as `Customer_Key`, but is only used as mutation return value. -""" -scalar Customer_KeyOutput -""" -✨ `Order_KeyOutput` returns the primary key fields of table type `Order`. - -It has the same format as `Order_Key`, but is only used as mutation return value. -""" -scalar Order_KeyOutput -""" -✨ `OrderItem_KeyOutput` returns the primary key fields of table type `OrderItem`. - -It has the same format as `OrderItem_Key`, but is only used as mutation return value. -""" -scalar OrderItem_KeyOutput -""" -✨ `Product_KeyOutput` returns the primary key fields of table type `Product`. - -It has the same format as `Product_Key`, but is only used as mutation return value. -""" -scalar Product_KeyOutput -""" -✨ `ProductCollection_KeyOutput` returns the primary key fields of table type `ProductCollection`. - -It has the same format as `ProductCollection_Key`, but is only used as mutation return value. -""" -scalar ProductCollection_KeyOutput -""" -✨ `ProductImage_KeyOutput` returns the primary key fields of table type `ProductImage`. - -It has the same format as `ProductImage_Key`, but is only used as mutation return value. -""" -scalar ProductImage_KeyOutput -""" -✨ `ProductOption_KeyOutput` returns the primary key fields of table type `ProductOption`. - -It has the same format as `ProductOption_Key`, but is only used as mutation return value. -""" -scalar ProductOption_KeyOutput -""" -✨ `ProductReview_KeyOutput` returns the primary key fields of table type `ProductReview`. - -It has the same format as `ProductReview_Key`, but is only used as mutation return value. -""" -scalar ProductReview_KeyOutput -""" -✨ `ProductVariant_KeyOutput` returns the primary key fields of table type `ProductVariant`. - -It has the same format as `ProductVariant_Key`, but is only used as mutation return value. -""" -scalar ProductVariant_KeyOutput -""" -✨ `SEO_KeyOutput` returns the primary key fields of table type `SEO`. - -It has the same format as `SEO_Key`, but is only used as mutation return value. -""" -scalar SEO_KeyOutput -""" -✨ `SelectedOption_KeyOutput` returns the primary key fields of table type `SelectedOption`. - -It has the same format as `SelectedOption_Key`, but is only used as mutation return value. -""" -scalar SelectedOption_KeyOutput -""" -✨ Generated data input type for table 'Collection'. It includes all necessary fields for creating or upserting rows into table. -""" -input Collection_Data { - """ - ✨ Generated from Field `Collection`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `Collection`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr - """ - ✨ Generated from Field `Collection`.`featuredImageId` of type `UUID` - """ - featuredImageId: UUID - """ - ✨ `_expr` server value variant of `featuredImageId` (✨ Generated from Field `Collection`.`featuredImageId` of type `UUID`) - """ - featuredImageId_expr: UUID_Expr - """ - ✨ Generated from Field `Collection`.`seoId` of type `UUID` - """ - seoId: UUID - """ - ✨ `_expr` server value variant of `seoId` (✨ Generated from Field `Collection`.`seoId` of type `UUID`) - """ - seoId_expr: UUID_Expr - """ - ✨ Generated from Field `Collection`.`featuredImage` of type `ProductImage` - """ - featuredImage: ProductImage_Key - """ - ✨ Generated from Field `Collection`.`seo` of type `SEO` - """ - seo: SEO_Key - """ - ✨ Generated from Field `Collection`.`createdAt` of type `Date!` - """ - createdAt: Date - """ - ✨ `_date` server value variant of `createdAt` (✨ Generated from Field `Collection`.`createdAt` of type `Date!`) - """ - createdAt_date: Date_Relative - """ - ✨ `_expr` server value variant of `createdAt` (✨ Generated from Field `Collection`.`createdAt` of type `Date!`) - """ - createdAt_expr: Date_Expr - """ - ✨ Generated from Field `Collection`.`description` of type `String` - """ - description: String - """ - ✨ `_expr` server value variant of `description` (✨ Generated from Field `Collection`.`description` of type `String`) - """ - description_expr: String_Expr - """ - ✨ Generated from Field `Collection`.`handle` of type `String!` - """ - handle: String - """ - ✨ `_expr` server value variant of `handle` (✨ Generated from Field `Collection`.`handle` of type `String!`) - """ - handle_expr: String_Expr - """ - ✨ Generated from Field `Collection`.`name` of type `String!` - """ - name: String - """ - ✨ `_expr` server value variant of `name` (✨ Generated from Field `Collection`.`name` of type `String!`) - """ - name_expr: String_Expr - """ - ✨ Generated from Field `Collection`.`page` of type `String` - """ - page: String - """ - ✨ `_expr` server value variant of `page` (✨ Generated from Field `Collection`.`page` of type `String`) - """ - page_expr: String_Expr - """ - ✨ Generated from Field `Collection`.`updatedAt` of type `Date!` - """ - updatedAt: Date - """ - ✨ `_date` server value variant of `updatedAt` (✨ Generated from Field `Collection`.`updatedAt` of type `Date!`) - """ - updatedAt_date: Date_Relative - """ - ✨ `_expr` server value variant of `updatedAt` (✨ Generated from Field `Collection`.`updatedAt` of type `Date!`) - """ - updatedAt_expr: Date_Expr -} -""" -✨ Generated filter input type for table 'Collection'. This input allows filtering objects using various conditions. Use `_or`, `_and`, and `_not` to compose complex filters. -""" -input Collection_Filter { - """ - Apply multiple filter conditions using `AND` logic. - """ - _and: [Collection_Filter!] - """ - Negate the result of the provided filter condition. - """ - _not: Collection_Filter - """ - Apply multiple filter conditions using `OR` logic. - """ - _or: [Collection_Filter!] - """ - ✨ Generated from Field `Collection`.`id` of type `UUID!` - """ - id: UUID_Filter - """ - ✨ Generated from Field `Collection`.`featuredImageId` of type `UUID` - """ - featuredImageId: UUID_Filter - """ - ✨ Generated from Field `Collection`.`seoId` of type `UUID` - """ - seoId: UUID_Filter - """ - ✨ Generated from Field `Collection`.`featuredImage` of type `ProductImage` - """ - featuredImage: ProductImage_Filter - """ - ✨ Generated from Field `Collection`.`seo` of type `SEO` - """ - seo: SEO_Filter - """ - ✨ Generated from Field `Collection`.`createdAt` of type `Date!` - """ - createdAt: Date_Filter - """ - ✨ Generated from Field `Collection`.`description` of type `String` - """ - description: String_Filter - """ - ✨ Generated from Field `Collection`.`handle` of type `String!` - """ - handle: String_Filter - """ - ✨ Generated from Field `Collection`.`name` of type `String!` - """ - name: String_Filter - """ - ✨ Generated from Field `Collection`.`page` of type `String` - """ - page: String_Filter - """ - ✨ Generated from Field `Collection`.`updatedAt` of type `Date!` - """ - updatedAt: Date_Filter - """ - ✨ Generated from Field `Collection`.`productCollections_on_collection` of type `[ProductCollection!]!` - """ - productCollections_on_collection: ProductCollection_ListFilter - """ - ✨ Generated from Field `Collection`.`products_via_ProductCollection` of type `[Product!]!` - """ - products_via_ProductCollection: Product_ListFilter -} -""" -✨ Generated first-row input type for table 'Collection'. This input selects the first row matching the filter criteria, ordered according to the specified conditions. -""" -input Collection_FirstRow { - """ - Order the result by the specified fields. - """ - orderBy: [Collection_Order!] - """ - Filters rows based on the specified conditions. - """ - where: Collection_Filter -} -""" -✨ Generated key input type for table 'Collection'. It represents the primary key fields used to uniquely identify a row in the table. -""" -input Collection_Key { - """ - ✨ Generated from Field `Collection`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `Collection`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr -} -""" -✨ Generated list filter input type for table 'Collection'. This input applies filtering logic based on the count or existence of related objects that matches certain criteria. -""" -input Collection_ListFilter { - """ - The desired number of objects that match the condition (defaults to at least one). - """ - count: Int_Filter = {gt:0} - """ - Condition of the related objects to filter for. - """ - exist: Collection_Filter -} -""" -✨ Generated order input type for table 'Collection'. This input defines the sorting order of rows in query results based on one or more fields. -""" -input Collection_Order { - """ - ✨ Generated from Field `Collection`.`id` of type `UUID!` - """ - id: OrderDirection - """ - ✨ Generated from Field `Collection`.`featuredImageId` of type `UUID` - """ - featuredImageId: OrderDirection - """ - ✨ Generated from Field `Collection`.`seoId` of type `UUID` - """ - seoId: OrderDirection - """ - ✨ Generated from Field `Collection`.`featuredImage` of type `ProductImage` - """ - featuredImage: ProductImage_Order - """ - ✨ Generated from Field `Collection`.`seo` of type `SEO` - """ - seo: SEO_Order - """ - ✨ Generated from Field `Collection`.`createdAt` of type `Date!` - """ - createdAt: OrderDirection - """ - ✨ Generated from Field `Collection`.`description` of type `String` - """ - description: OrderDirection - """ - ✨ Generated from Field `Collection`.`handle` of type `String!` - """ - handle: OrderDirection - """ - ✨ Generated from Field `Collection`.`name` of type `String!` - """ - name: OrderDirection - """ - ✨ Generated from Field `Collection`.`page` of type `String` - """ - page: OrderDirection - """ - ✨ Generated from Field `Collection`.`updatedAt` of type `Date!` - """ - updatedAt: OrderDirection -} -""" -✨ Generated data input type for table 'Customer'. It includes all necessary fields for creating or upserting rows into table. -""" -input Customer_Data { - """ - ✨ Generated from Field `Customer`.`id` of type `String!` - """ - id: String - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `Customer`.`id` of type `String!`) - """ - id_expr: String_Expr - """ - ✨ Generated from Field `Customer`.`acceptsMarketing` of type `Boolean!` - """ - acceptsMarketing: Boolean - """ - ✨ Generated from Field `Customer`.`email` of type `String!` - """ - email: String - """ - ✨ `_expr` server value variant of `email` (✨ Generated from Field `Customer`.`email` of type `String!`) - """ - email_expr: String_Expr - """ - ✨ Generated from Field `Customer`.`firstName` of type `String!` - """ - firstName: String - """ - ✨ `_expr` server value variant of `firstName` (✨ Generated from Field `Customer`.`firstName` of type `String!`) - """ - firstName_expr: String_Expr - """ - ✨ Generated from Field `Customer`.`lastName` of type `String!` - """ - lastName: String - """ - ✨ `_expr` server value variant of `lastName` (✨ Generated from Field `Customer`.`lastName` of type `String!`) - """ - lastName_expr: String_Expr - """ - ✨ Generated from Field `Customer`.`phone` of type `String!` - """ - phone: String - """ - ✨ `_expr` server value variant of `phone` (✨ Generated from Field `Customer`.`phone` of type `String!`) - """ - phone_expr: String_Expr -} -""" -✨ Generated filter input type for table 'Customer'. This input allows filtering objects using various conditions. Use `_or`, `_and`, and `_not` to compose complex filters. -""" -input Customer_Filter { - """ - Apply multiple filter conditions using `AND` logic. - """ - _and: [Customer_Filter!] - """ - Negate the result of the provided filter condition. - """ - _not: Customer_Filter - """ - Apply multiple filter conditions using `OR` logic. - """ - _or: [Customer_Filter!] - """ - ✨ Generated from Field `Customer`.`id` of type `String!` - """ - id: String_Filter - """ - ✨ Generated from Field `Customer`.`acceptsMarketing` of type `Boolean!` - """ - acceptsMarketing: Boolean_Filter - """ - ✨ Generated from Field `Customer`.`email` of type `String!` - """ - email: String_Filter - """ - ✨ Generated from Field `Customer`.`firstName` of type `String!` - """ - firstName: String_Filter - """ - ✨ Generated from Field `Customer`.`lastName` of type `String!` - """ - lastName: String_Filter - """ - ✨ Generated from Field `Customer`.`phone` of type `String!` - """ - phone: String_Filter - """ - ✨ Generated from Field `Customer`.`orders_on_customer` of type `[Order!]!` - """ - orders_on_customer: Order_ListFilter - """ - ✨ Generated from Field `Customer`.`productReviews_on_customer` of type `[ProductReview!]!` - """ - productReviews_on_customer: ProductReview_ListFilter - """ - ✨ Generated from Field `Customer`.`products_via_ProductReview` of type `[Product!]!` - """ - products_via_ProductReview: Product_ListFilter -} -""" -✨ Generated first-row input type for table 'Customer'. This input selects the first row matching the filter criteria, ordered according to the specified conditions. -""" -input Customer_FirstRow { - """ - Order the result by the specified fields. - """ - orderBy: [Customer_Order!] - """ - Filters rows based on the specified conditions. - """ - where: Customer_Filter -} -""" -✨ Generated key input type for table 'Customer'. It represents the primary key fields used to uniquely identify a row in the table. -""" -input Customer_Key { - """ - ✨ Generated from Field `Customer`.`id` of type `String!` - """ - id: String - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `Customer`.`id` of type `String!`) - """ - id_expr: String_Expr -} -""" -✨ Generated list filter input type for table 'Customer'. This input applies filtering logic based on the count or existence of related objects that matches certain criteria. -""" -input Customer_ListFilter { - """ - The desired number of objects that match the condition (defaults to at least one). - """ - count: Int_Filter = {gt:0} - """ - Condition of the related objects to filter for. - """ - exist: Customer_Filter -} -""" -✨ Generated order input type for table 'Customer'. This input defines the sorting order of rows in query results based on one or more fields. -""" -input Customer_Order { - """ - ✨ Generated from Field `Customer`.`id` of type `String!` - """ - id: OrderDirection - """ - ✨ Generated from Field `Customer`.`acceptsMarketing` of type `Boolean!` - """ - acceptsMarketing: OrderDirection - """ - ✨ Generated from Field `Customer`.`email` of type `String!` - """ - email: OrderDirection - """ - ✨ Generated from Field `Customer`.`firstName` of type `String!` - """ - firstName: OrderDirection - """ - ✨ Generated from Field `Customer`.`lastName` of type `String!` - """ - lastName: OrderDirection - """ - ✨ Generated from Field `Customer`.`phone` of type `String!` - """ - phone: OrderDirection -} -""" -✨ Generated data input type for table 'Order'. It includes all necessary fields for creating or upserting rows into table. -""" -input Order_Data { - """ - ✨ Generated from Field `Order`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `Order`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr - """ - ✨ Generated from Field `Order`.`customerId` of type `String!` - """ - customerId: String - """ - ✨ `_expr` server value variant of `customerId` (✨ Generated from Field `Order`.`customerId` of type `String!`) - """ - customerId_expr: String_Expr - """ - ✨ Generated from Field `Order`.`customer` of type `Customer!` - """ - customer: Customer_Key - """ - ✨ Generated from Field `Order`.`chargeId` of type `String` - """ - chargeId: String - """ - ✨ `_expr` server value variant of `chargeId` (✨ Generated from Field `Order`.`chargeId` of type `String`) - """ - chargeId_expr: String_Expr - """ - ✨ Generated from Field `Order`.`financialStatus` of type `String!` - """ - financialStatus: String - """ - ✨ `_expr` server value variant of `financialStatus` (✨ Generated from Field `Order`.`financialStatus` of type `String!`) - """ - financialStatus_expr: String_Expr - """ - ✨ Generated from Field `Order`.`fulfillmentStatus` of type `String!` - """ - fulfillmentStatus: String - """ - ✨ `_expr` server value variant of `fulfillmentStatus` (✨ Generated from Field `Order`.`fulfillmentStatus` of type `String!`) - """ - fulfillmentStatus_expr: String_Expr - """ - ✨ Generated from Field `Order`.`paymentIntentId` of type `String` - """ - paymentIntentId: String - """ - ✨ `_expr` server value variant of `paymentIntentId` (✨ Generated from Field `Order`.`paymentIntentId` of type `String`) - """ - paymentIntentId_expr: String_Expr - """ - ✨ Generated from Field `Order`.`processedAt` of type `Date!` - """ - processedAt: Date - """ - ✨ `_date` server value variant of `processedAt` (✨ Generated from Field `Order`.`processedAt` of type `Date!`) - """ - processedAt_date: Date_Relative - """ - ✨ `_expr` server value variant of `processedAt` (✨ Generated from Field `Order`.`processedAt` of type `Date!`) - """ - processedAt_expr: Date_Expr - """ - ✨ Generated from Field `Order`.`receiptUrl` of type `String` - """ - receiptUrl: String - """ - ✨ `_expr` server value variant of `receiptUrl` (✨ Generated from Field `Order`.`receiptUrl` of type `String`) - """ - receiptUrl_expr: String_Expr - """ - ✨ Generated from Field `Order`.`subtotalPrice` of type `Float!` - """ - subtotalPrice: Float - """ - ✨ Generated from Field `Order`.`totalPrice` of type `Float!` - """ - totalPrice: Float - """ - ✨ Generated from Field `Order`.`totalShippingPrice` of type `Float!` - """ - totalShippingPrice: Float - """ - ✨ Generated from Field `Order`.`totalTax` of type `Float!` - """ - totalTax: Float -} -""" -✨ Generated filter input type for table 'Order'. This input allows filtering objects using various conditions. Use `_or`, `_and`, and `_not` to compose complex filters. -""" -input Order_Filter { - """ - Apply multiple filter conditions using `AND` logic. - """ - _and: [Order_Filter!] - """ - Negate the result of the provided filter condition. - """ - _not: Order_Filter - """ - Apply multiple filter conditions using `OR` logic. - """ - _or: [Order_Filter!] - """ - ✨ Generated from Field `Order`.`id` of type `UUID!` - """ - id: UUID_Filter - """ - ✨ Generated from Field `Order`.`customerId` of type `String!` - """ - customerId: String_Filter - """ - ✨ Generated from Field `Order`.`customer` of type `Customer!` - """ - customer: Customer_Filter - """ - ✨ Generated from Field `Order`.`chargeId` of type `String` - """ - chargeId: String_Filter - """ - ✨ Generated from Field `Order`.`financialStatus` of type `String!` - """ - financialStatus: String_Filter - """ - ✨ Generated from Field `Order`.`fulfillmentStatus` of type `String!` - """ - fulfillmentStatus: String_Filter - """ - ✨ Generated from Field `Order`.`paymentIntentId` of type `String` - """ - paymentIntentId: String_Filter - """ - ✨ Generated from Field `Order`.`processedAt` of type `Date!` - """ - processedAt: Date_Filter - """ - ✨ Generated from Field `Order`.`receiptUrl` of type `String` - """ - receiptUrl: String_Filter - """ - ✨ Generated from Field `Order`.`subtotalPrice` of type `Float!` - """ - subtotalPrice: Float_Filter - """ - ✨ Generated from Field `Order`.`totalPrice` of type `Float!` - """ - totalPrice: Float_Filter - """ - ✨ Generated from Field `Order`.`totalShippingPrice` of type `Float!` - """ - totalShippingPrice: Float_Filter - """ - ✨ Generated from Field `Order`.`totalTax` of type `Float!` - """ - totalTax: Float_Filter - """ - ✨ Generated from Field `Order`.`orderItems_on_order` of type `[OrderItem!]!` - """ - orderItems_on_order: OrderItem_ListFilter -} -""" -✨ Generated first-row input type for table 'Order'. This input selects the first row matching the filter criteria, ordered according to the specified conditions. -""" -input Order_FirstRow { - """ - Order the result by the specified fields. - """ - orderBy: [Order_Order!] - """ - Filters rows based on the specified conditions. - """ - where: Order_Filter -} -""" -✨ Generated key input type for table 'Order'. It represents the primary key fields used to uniquely identify a row in the table. -""" -input Order_Key { - """ - ✨ Generated from Field `Order`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `Order`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr -} -""" -✨ Generated list filter input type for table 'Order'. This input applies filtering logic based on the count or existence of related objects that matches certain criteria. -""" -input Order_ListFilter { - """ - The desired number of objects that match the condition (defaults to at least one). - """ - count: Int_Filter = {gt:0} - """ - Condition of the related objects to filter for. - """ - exist: Order_Filter -} -""" -✨ Generated order input type for table 'Order'. This input defines the sorting order of rows in query results based on one or more fields. -""" -input Order_Order { - """ - ✨ Generated from Field `Order`.`id` of type `UUID!` - """ - id: OrderDirection - """ - ✨ Generated from Field `Order`.`customerId` of type `String!` - """ - customerId: OrderDirection - """ - ✨ Generated from Field `Order`.`customer` of type `Customer!` - """ - customer: Customer_Order - """ - ✨ Generated from Field `Order`.`chargeId` of type `String` - """ - chargeId: OrderDirection - """ - ✨ Generated from Field `Order`.`financialStatus` of type `String!` - """ - financialStatus: OrderDirection - """ - ✨ Generated from Field `Order`.`fulfillmentStatus` of type `String!` - """ - fulfillmentStatus: OrderDirection - """ - ✨ Generated from Field `Order`.`paymentIntentId` of type `String` - """ - paymentIntentId: OrderDirection - """ - ✨ Generated from Field `Order`.`processedAt` of type `Date!` - """ - processedAt: OrderDirection - """ - ✨ Generated from Field `Order`.`receiptUrl` of type `String` - """ - receiptUrl: OrderDirection - """ - ✨ Generated from Field `Order`.`subtotalPrice` of type `Float!` - """ - subtotalPrice: OrderDirection - """ - ✨ Generated from Field `Order`.`totalPrice` of type `Float!` - """ - totalPrice: OrderDirection - """ - ✨ Generated from Field `Order`.`totalShippingPrice` of type `Float!` - """ - totalShippingPrice: OrderDirection - """ - ✨ Generated from Field `Order`.`totalTax` of type `Float!` - """ - totalTax: OrderDirection -} -""" -✨ Generated data input type for table 'OrderItem'. It includes all necessary fields for creating or upserting rows into table. -""" -input OrderItem_Data { - """ - ✨ Generated from Field `OrderItem`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `OrderItem`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr - """ - ✨ Generated from Field `OrderItem`.`orderId` of type `UUID!` - """ - orderId: UUID - """ - ✨ `_expr` server value variant of `orderId` (✨ Generated from Field `OrderItem`.`orderId` of type `UUID!`) - """ - orderId_expr: UUID_Expr - """ - ✨ Generated from Field `OrderItem`.`productId` of type `UUID!` - """ - productId: UUID - """ - ✨ `_expr` server value variant of `productId` (✨ Generated from Field `OrderItem`.`productId` of type `UUID!`) - """ - productId_expr: UUID_Expr - """ - ✨ Generated from Field `OrderItem`.`order` of type `Order!` - """ - order: Order_Key - """ - ✨ Generated from Field `OrderItem`.`product` of type `Product!` - """ - product: Product_Key - """ - ✨ Generated from Field `OrderItem`.`price` of type `Float!` - """ - price: Float - """ - ✨ Generated from Field `OrderItem`.`quantity` of type `Int!` - """ - quantity: Int - """ - ✨ `_expr` server value variant of `quantity` (✨ Generated from Field `OrderItem`.`quantity` of type `Int!`) - """ - quantity_expr: Int_Expr -} -""" -✨ Generated filter input type for table 'OrderItem'. This input allows filtering objects using various conditions. Use `_or`, `_and`, and `_not` to compose complex filters. -""" -input OrderItem_Filter { - """ - Apply multiple filter conditions using `AND` logic. - """ - _and: [OrderItem_Filter!] - """ - Negate the result of the provided filter condition. - """ - _not: OrderItem_Filter - """ - Apply multiple filter conditions using `OR` logic. - """ - _or: [OrderItem_Filter!] - """ - ✨ Generated from Field `OrderItem`.`id` of type `UUID!` - """ - id: UUID_Filter - """ - ✨ Generated from Field `OrderItem`.`orderId` of type `UUID!` - """ - orderId: UUID_Filter - """ - ✨ Generated from Field `OrderItem`.`productId` of type `UUID!` - """ - productId: UUID_Filter - """ - ✨ Generated from Field `OrderItem`.`order` of type `Order!` - """ - order: Order_Filter - """ - ✨ Generated from Field `OrderItem`.`product` of type `Product!` - """ - product: Product_Filter - """ - ✨ Generated from Field `OrderItem`.`price` of type `Float!` - """ - price: Float_Filter - """ - ✨ Generated from Field `OrderItem`.`quantity` of type `Int!` - """ - quantity: Int_Filter -} -""" -✨ Generated first-row input type for table 'OrderItem'. This input selects the first row matching the filter criteria, ordered according to the specified conditions. -""" -input OrderItem_FirstRow { - """ - Order the result by the specified fields. - """ - orderBy: [OrderItem_Order!] - """ - Filters rows based on the specified conditions. - """ - where: OrderItem_Filter -} -""" -✨ Generated key input type for table 'OrderItem'. It represents the primary key fields used to uniquely identify a row in the table. -""" -input OrderItem_Key { - """ - ✨ Generated from Field `OrderItem`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `OrderItem`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr -} -""" -✨ Generated list filter input type for table 'OrderItem'. This input applies filtering logic based on the count or existence of related objects that matches certain criteria. -""" -input OrderItem_ListFilter { - """ - The desired number of objects that match the condition (defaults to at least one). - """ - count: Int_Filter = {gt:0} - """ - Condition of the related objects to filter for. - """ - exist: OrderItem_Filter -} -""" -✨ Generated order input type for table 'OrderItem'. This input defines the sorting order of rows in query results based on one or more fields. -""" -input OrderItem_Order { - """ - ✨ Generated from Field `OrderItem`.`id` of type `UUID!` - """ - id: OrderDirection - """ - ✨ Generated from Field `OrderItem`.`orderId` of type `UUID!` - """ - orderId: OrderDirection - """ - ✨ Generated from Field `OrderItem`.`productId` of type `UUID!` - """ - productId: OrderDirection - """ - ✨ Generated from Field `OrderItem`.`order` of type `Order!` - """ - order: Order_Order - """ - ✨ Generated from Field `OrderItem`.`product` of type `Product!` - """ - product: Product_Order - """ - ✨ Generated from Field `OrderItem`.`price` of type `Float!` - """ - price: OrderDirection - """ - ✨ Generated from Field `OrderItem`.`quantity` of type `Int!` - """ - quantity: OrderDirection -} -""" -✨ Generated data input type for table 'Product'. It includes all necessary fields for creating or upserting rows into table. -""" -input Product_Data { - """ - ✨ Generated from Field `Product`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `Product`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr - """ - ✨ Generated from Field `Product`.`featuredImageId` of type `UUID` - """ - featuredImageId: UUID - """ - ✨ `_expr` server value variant of `featuredImageId` (✨ Generated from Field `Product`.`featuredImageId` of type `UUID`) - """ - featuredImageId_expr: UUID_Expr - """ - ✨ Generated from Field `Product`.`seoId` of type `UUID` - """ - seoId: UUID - """ - ✨ `_expr` server value variant of `seoId` (✨ Generated from Field `Product`.`seoId` of type `UUID`) - """ - seoId_expr: UUID_Expr - """ - ✨ Generated from Field `Product`.`featuredImage` of type `ProductImage` - """ - featuredImage: ProductImage_Key - """ - ✨ Generated from Field `Product`.`seo` of type `SEO` - """ - seo: SEO_Key - """ - ✨ Generated from Field `Product`.`availableForSale` of type `Boolean!` - """ - availableForSale: Boolean - """ - ✨ Generated from Field `Product`.`createdAt` of type `Date!` - """ - createdAt: Date - """ - ✨ `_date` server value variant of `createdAt` (✨ Generated from Field `Product`.`createdAt` of type `Date!`) - """ - createdAt_date: Date_Relative - """ - ✨ `_expr` server value variant of `createdAt` (✨ Generated from Field `Product`.`createdAt` of type `Date!`) - """ - createdAt_expr: Date_Expr - """ - ✨ Generated from Field `Product`.`description` of type `String` - """ - description: String - """ - ✨ `_expr` server value variant of `description` (✨ Generated from Field `Product`.`description` of type `String`) - """ - description_expr: String_Expr - """ - ✨ Generated from Field `Product`.`descriptionEmbedding` of type `Vector!` - """ - descriptionEmbedding: Vector - """ - ✨ `_embed` server value variant of `descriptionEmbedding` (✨ Generated from Field `Product`.`descriptionEmbedding` of type `Vector!`) - """ - descriptionEmbedding_embed: Vector_Embed - """ - ✨ Generated from Field `Product`.`handle` of type `String!` - """ - handle: String - """ - ✨ `_expr` server value variant of `handle` (✨ Generated from Field `Product`.`handle` of type `String!`) - """ - handle_expr: String_Expr - """ - ✨ Generated from Field `Product`.`productType` of type `String` - """ - productType: String - """ - ✨ `_expr` server value variant of `productType` (✨ Generated from Field `Product`.`productType` of type `String`) - """ - productType_expr: String_Expr - """ - ✨ Generated from Field `Product`.`title` of type `String!` - """ - title: String - """ - ✨ `_expr` server value variant of `title` (✨ Generated from Field `Product`.`title` of type `String!`) - """ - title_expr: String_Expr - """ - ✨ Generated from Field `Product`.`titleEmbedding` of type `Vector!` - """ - titleEmbedding: Vector - """ - ✨ `_embed` server value variant of `titleEmbedding` (✨ Generated from Field `Product`.`titleEmbedding` of type `Vector!`) - """ - titleEmbedding_embed: Vector_Embed - """ - ✨ Generated from Field `Product`.`updatedAt` of type `Date!` - """ - updatedAt: Date - """ - ✨ `_date` server value variant of `updatedAt` (✨ Generated from Field `Product`.`updatedAt` of type `Date!`) - """ - updatedAt_date: Date_Relative - """ - ✨ `_expr` server value variant of `updatedAt` (✨ Generated from Field `Product`.`updatedAt` of type `Date!`) - """ - updatedAt_expr: Date_Expr -} -""" -✨ Generated filter input type for table 'Product'. This input allows filtering objects using various conditions. Use `_or`, `_and`, and `_not` to compose complex filters. -""" -input Product_Filter { - """ - Apply multiple filter conditions using `AND` logic. - """ - _and: [Product_Filter!] - """ - Negate the result of the provided filter condition. - """ - _not: Product_Filter - """ - Apply multiple filter conditions using `OR` logic. - """ - _or: [Product_Filter!] - """ - ✨ Generated from Field `Product`.`id` of type `UUID!` - """ - id: UUID_Filter - """ - ✨ Generated from Field `Product`.`featuredImageId` of type `UUID` - """ - featuredImageId: UUID_Filter - """ - ✨ Generated from Field `Product`.`seoId` of type `UUID` - """ - seoId: UUID_Filter - """ - ✨ Generated from Field `Product`.`featuredImage` of type `ProductImage` - """ - featuredImage: ProductImage_Filter - """ - ✨ Generated from Field `Product`.`seo` of type `SEO` - """ - seo: SEO_Filter - """ - ✨ Generated from Field `Product`.`availableForSale` of type `Boolean!` - """ - availableForSale: Boolean_Filter - """ - ✨ Generated from Field `Product`.`createdAt` of type `Date!` - """ - createdAt: Date_Filter - """ - ✨ Generated from Field `Product`.`description` of type `String` - """ - description: String_Filter - """ - ✨ Generated from Field `Product`.`descriptionEmbedding` of type `Vector!` - """ - descriptionEmbedding: Vector_Filter - """ - ✨ Generated from Field `Product`.`handle` of type `String!` - """ - handle: String_Filter - """ - ✨ Generated from Field `Product`.`productType` of type `String` - """ - productType: String_Filter - """ - ✨ Generated from Field `Product`.`title` of type `String!` - """ - title: String_Filter - """ - ✨ Generated from Field `Product`.`titleEmbedding` of type `Vector!` - """ - titleEmbedding: Vector_Filter - """ - ✨ Generated from Field `Product`.`updatedAt` of type `Date!` - """ - updatedAt: Date_Filter - """ - ✨ Generated from Field `Product`.`orderItems_on_product` of type `[OrderItem!]!` - """ - orderItems_on_product: OrderItem_ListFilter - """ - ✨ Generated from Field `Product`.`productCollections_on_product` of type `[ProductCollection!]!` - """ - productCollections_on_product: ProductCollection_ListFilter - """ - ✨ Generated from Field `Product`.`productImages_on_product` of type `[ProductImage!]!` - """ - productImages_on_product: ProductImage_ListFilter - """ - ✨ Generated from Field `Product`.`productOptions_on_product` of type `[ProductOption!]!` - """ - productOptions_on_product: ProductOption_ListFilter - """ - ✨ Generated from Field `Product`.`productReviews_on_product` of type `[ProductReview!]!` - """ - productReviews_on_product: ProductReview_ListFilter - """ - ✨ Generated from Field `Product`.`productVariants_on_product` of type `[ProductVariant!]!` - """ - productVariants_on_product: ProductVariant_ListFilter - """ - ✨ Generated from Field `Product`.`collections_via_ProductCollection` of type `[Collection!]!` - """ - collections_via_ProductCollection: Collection_ListFilter - """ - ✨ Generated from Field `Product`.`customers_via_ProductReview` of type `[Customer!]!` - """ - customers_via_ProductReview: Customer_ListFilter -} -""" -✨ Generated first-row input type for table 'Product'. This input selects the first row matching the filter criteria, ordered according to the specified conditions. -""" -input Product_FirstRow { - """ - Order the result by the specified fields. - """ - orderBy: [Product_Order!] - """ - Filters rows based on the specified conditions. - """ - where: Product_Filter -} -""" -✨ Generated key input type for table 'Product'. It represents the primary key fields used to uniquely identify a row in the table. -""" -input Product_Key { - """ - ✨ Generated from Field `Product`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `Product`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr -} -""" -✨ Generated list filter input type for table 'Product'. This input applies filtering logic based on the count or existence of related objects that matches certain criteria. -""" -input Product_ListFilter { - """ - The desired number of objects that match the condition (defaults to at least one). - """ - count: Int_Filter = {gt:0} - """ - Condition of the related objects to filter for. - """ - exist: Product_Filter -} -""" -✨ Generated order input type for table 'Product'. This input defines the sorting order of rows in query results based on one or more fields. -""" -input Product_Order { - """ - ✨ Generated from Field `Product`.`id` of type `UUID!` - """ - id: OrderDirection - """ - ✨ Generated from Field `Product`.`featuredImageId` of type `UUID` - """ - featuredImageId: OrderDirection - """ - ✨ Generated from Field `Product`.`seoId` of type `UUID` - """ - seoId: OrderDirection - """ - ✨ Generated from Field `Product`.`featuredImage` of type `ProductImage` - """ - featuredImage: ProductImage_Order - """ - ✨ Generated from Field `Product`.`seo` of type `SEO` - """ - seo: SEO_Order - """ - ✨ Generated from Field `Product`.`availableForSale` of type `Boolean!` - """ - availableForSale: OrderDirection - """ - ✨ Generated from Field `Product`.`createdAt` of type `Date!` - """ - createdAt: OrderDirection - """ - ✨ Generated from Field `Product`.`description` of type `String` - """ - description: OrderDirection - """ - ✨ Generated from Field `Product`.`descriptionEmbedding` of type `Vector!` - """ - descriptionEmbedding: OrderDirection - """ - ✨ Generated from Field `Product`.`handle` of type `String!` - """ - handle: OrderDirection - """ - ✨ Generated from Field `Product`.`productType` of type `String` - """ - productType: OrderDirection - """ - ✨ Generated from Field `Product`.`title` of type `String!` - """ - title: OrderDirection - """ - ✨ Generated from Field `Product`.`titleEmbedding` of type `Vector!` - """ - titleEmbedding: OrderDirection - """ - ✨ Generated from Field `Product`.`updatedAt` of type `Date!` - """ - updatedAt: OrderDirection -} -""" -✨ Generated data input type for table 'ProductCollection'. It includes all necessary fields for creating or upserting rows into table. -""" -input ProductCollection_Data { - """ - ✨ Generated from Field `ProductCollection`.`collectionId` of type `UUID!` - """ - collectionId: UUID - """ - ✨ `_expr` server value variant of `collectionId` (✨ Generated from Field `ProductCollection`.`collectionId` of type `UUID!`) - """ - collectionId_expr: UUID_Expr - """ - ✨ Generated from Field `ProductCollection`.`productId` of type `UUID!` - """ - productId: UUID - """ - ✨ `_expr` server value variant of `productId` (✨ Generated from Field `ProductCollection`.`productId` of type `UUID!`) - """ - productId_expr: UUID_Expr - """ - ✨ Generated from Field `ProductCollection`.`collection` of type `Collection!` - """ - collection: Collection_Key - """ - ✨ Generated from Field `ProductCollection`.`product` of type `Product!` - """ - product: Product_Key - """ - ✨ Generated from Field `ProductCollection`.`displayPosition` of type `Int!` - """ - displayPosition: Int - """ - ✨ `_expr` server value variant of `displayPosition` (✨ Generated from Field `ProductCollection`.`displayPosition` of type `Int!`) - """ - displayPosition_expr: Int_Expr -} -""" -✨ Generated filter input type for table 'ProductCollection'. This input allows filtering objects using various conditions. Use `_or`, `_and`, and `_not` to compose complex filters. -""" -input ProductCollection_Filter { - """ - Apply multiple filter conditions using `AND` logic. - """ - _and: [ProductCollection_Filter!] - """ - Negate the result of the provided filter condition. - """ - _not: ProductCollection_Filter - """ - Apply multiple filter conditions using `OR` logic. - """ - _or: [ProductCollection_Filter!] - """ - ✨ Generated from Field `ProductCollection`.`collectionId` of type `UUID!` - """ - collectionId: UUID_Filter - """ - ✨ Generated from Field `ProductCollection`.`productId` of type `UUID!` - """ - productId: UUID_Filter - """ - ✨ Generated from Field `ProductCollection`.`collection` of type `Collection!` - """ - collection: Collection_Filter - """ - ✨ Generated from Field `ProductCollection`.`product` of type `Product!` - """ - product: Product_Filter - """ - ✨ Generated from Field `ProductCollection`.`displayPosition` of type `Int!` - """ - displayPosition: Int_Filter -} -""" -✨ Generated first-row input type for table 'ProductCollection'. This input selects the first row matching the filter criteria, ordered according to the specified conditions. -""" -input ProductCollection_FirstRow { - """ - Order the result by the specified fields. - """ - orderBy: [ProductCollection_Order!] - """ - Filters rows based on the specified conditions. - """ - where: ProductCollection_Filter -} -""" -✨ Generated key input type for table 'ProductCollection'. It represents the primary key fields used to uniquely identify a row in the table. -""" -input ProductCollection_Key { - """ - ✨ Generated from Field `ProductCollection`.`collectionId` of type `UUID!` - """ - collectionId: UUID - """ - ✨ `_expr` server value variant of `collectionId` (✨ Generated from Field `ProductCollection`.`collectionId` of type `UUID!`) - """ - collectionId_expr: UUID_Expr - """ - ✨ Generated from Field `ProductCollection`.`productId` of type `UUID!` - """ - productId: UUID - """ - ✨ `_expr` server value variant of `productId` (✨ Generated from Field `ProductCollection`.`productId` of type `UUID!`) - """ - productId_expr: UUID_Expr -} -""" -✨ Generated list filter input type for table 'ProductCollection'. This input applies filtering logic based on the count or existence of related objects that matches certain criteria. -""" -input ProductCollection_ListFilter { - """ - The desired number of objects that match the condition (defaults to at least one). - """ - count: Int_Filter = {gt:0} - """ - Condition of the related objects to filter for. - """ - exist: ProductCollection_Filter -} -""" -✨ Generated order input type for table 'ProductCollection'. This input defines the sorting order of rows in query results based on one or more fields. -""" -input ProductCollection_Order { - """ - ✨ Generated from Field `ProductCollection`.`collectionId` of type `UUID!` - """ - collectionId: OrderDirection - """ - ✨ Generated from Field `ProductCollection`.`productId` of type `UUID!` - """ - productId: OrderDirection - """ - ✨ Generated from Field `ProductCollection`.`collection` of type `Collection!` - """ - collection: Collection_Order - """ - ✨ Generated from Field `ProductCollection`.`product` of type `Product!` - """ - product: Product_Order - """ - ✨ Generated from Field `ProductCollection`.`displayPosition` of type `Int!` - """ - displayPosition: OrderDirection -} -""" -✨ Generated data input type for table 'ProductImage'. It includes all necessary fields for creating or upserting rows into table. -""" -input ProductImage_Data { - """ - ✨ Generated from Field `ProductImage`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `ProductImage`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr - """ - ✨ Generated from Field `ProductImage`.`productId` of type `UUID!` - """ - productId: UUID - """ - ✨ `_expr` server value variant of `productId` (✨ Generated from Field `ProductImage`.`productId` of type `UUID!`) - """ - productId_expr: UUID_Expr - """ - ✨ Generated from Field `ProductImage`.`product` of type `Product!` - """ - product: Product_Key - """ - ✨ Generated from Field `ProductImage`.`altText` of type `String` - """ - altText: String - """ - ✨ `_expr` server value variant of `altText` (✨ Generated from Field `ProductImage`.`altText` of type `String`) - """ - altText_expr: String_Expr - """ - ✨ Generated from Field `ProductImage`.`displayPosition` of type `Int!` - """ - displayPosition: Int - """ - ✨ `_expr` server value variant of `displayPosition` (✨ Generated from Field `ProductImage`.`displayPosition` of type `Int!`) - """ - displayPosition_expr: Int_Expr - """ - ✨ Generated from Field `ProductImage`.`featured` of type `Boolean!` - """ - featured: Boolean - """ - ✨ Generated from Field `ProductImage`.`height` of type `Int!` - """ - height: Int - """ - ✨ `_expr` server value variant of `height` (✨ Generated from Field `ProductImage`.`height` of type `Int!`) - """ - height_expr: Int_Expr - """ - ✨ Generated from Field `ProductImage`.`url` of type `String!` - """ - url: String - """ - ✨ `_expr` server value variant of `url` (✨ Generated from Field `ProductImage`.`url` of type `String!`) - """ - url_expr: String_Expr - """ - ✨ Generated from Field `ProductImage`.`width` of type `Int!` - """ - width: Int - """ - ✨ `_expr` server value variant of `width` (✨ Generated from Field `ProductImage`.`width` of type `Int!`) - """ - width_expr: Int_Expr -} -""" -✨ Generated filter input type for table 'ProductImage'. This input allows filtering objects using various conditions. Use `_or`, `_and`, and `_not` to compose complex filters. -""" -input ProductImage_Filter { - """ - Apply multiple filter conditions using `AND` logic. - """ - _and: [ProductImage_Filter!] - """ - Negate the result of the provided filter condition. - """ - _not: ProductImage_Filter - """ - Apply multiple filter conditions using `OR` logic. - """ - _or: [ProductImage_Filter!] - """ - ✨ Generated from Field `ProductImage`.`id` of type `UUID!` - """ - id: UUID_Filter - """ - ✨ Generated from Field `ProductImage`.`productId` of type `UUID!` - """ - productId: UUID_Filter - """ - ✨ Generated from Field `ProductImage`.`product` of type `Product!` - """ - product: Product_Filter - """ - ✨ Generated from Field `ProductImage`.`altText` of type `String` - """ - altText: String_Filter - """ - ✨ Generated from Field `ProductImage`.`displayPosition` of type `Int!` - """ - displayPosition: Int_Filter - """ - ✨ Generated from Field `ProductImage`.`featured` of type `Boolean!` - """ - featured: Boolean_Filter - """ - ✨ Generated from Field `ProductImage`.`height` of type `Int!` - """ - height: Int_Filter - """ - ✨ Generated from Field `ProductImage`.`url` of type `String!` - """ - url: String_Filter - """ - ✨ Generated from Field `ProductImage`.`width` of type `Int!` - """ - width: Int_Filter - """ - ✨ Generated from Field `ProductImage`.`collections_on_featuredImage` of type `[Collection!]!` - """ - collections_on_featuredImage: Collection_ListFilter - """ - ✨ Generated from Field `ProductImage`.`products_on_featuredImage` of type `[Product!]!` - """ - products_on_featuredImage: Product_ListFilter -} -""" -✨ Generated first-row input type for table 'ProductImage'. This input selects the first row matching the filter criteria, ordered according to the specified conditions. -""" -input ProductImage_FirstRow { - """ - Order the result by the specified fields. - """ - orderBy: [ProductImage_Order!] - """ - Filters rows based on the specified conditions. - """ - where: ProductImage_Filter -} -""" -✨ Generated key input type for table 'ProductImage'. It represents the primary key fields used to uniquely identify a row in the table. -""" -input ProductImage_Key { - """ - ✨ Generated from Field `ProductImage`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `ProductImage`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr -} -""" -✨ Generated list filter input type for table 'ProductImage'. This input applies filtering logic based on the count or existence of related objects that matches certain criteria. -""" -input ProductImage_ListFilter { - """ - The desired number of objects that match the condition (defaults to at least one). - """ - count: Int_Filter = {gt:0} - """ - Condition of the related objects to filter for. - """ - exist: ProductImage_Filter -} -""" -✨ Generated order input type for table 'ProductImage'. This input defines the sorting order of rows in query results based on one or more fields. -""" -input ProductImage_Order { - """ - ✨ Generated from Field `ProductImage`.`id` of type `UUID!` - """ - id: OrderDirection - """ - ✨ Generated from Field `ProductImage`.`productId` of type `UUID!` - """ - productId: OrderDirection - """ - ✨ Generated from Field `ProductImage`.`product` of type `Product!` - """ - product: Product_Order - """ - ✨ Generated from Field `ProductImage`.`altText` of type `String` - """ - altText: OrderDirection - """ - ✨ Generated from Field `ProductImage`.`displayPosition` of type `Int!` - """ - displayPosition: OrderDirection - """ - ✨ Generated from Field `ProductImage`.`featured` of type `Boolean!` - """ - featured: OrderDirection - """ - ✨ Generated from Field `ProductImage`.`height` of type `Int!` - """ - height: OrderDirection - """ - ✨ Generated from Field `ProductImage`.`url` of type `String!` - """ - url: OrderDirection - """ - ✨ Generated from Field `ProductImage`.`width` of type `Int!` - """ - width: OrderDirection -} -""" -✨ Generated data input type for table 'ProductOption'. It includes all necessary fields for creating or upserting rows into table. -""" -input ProductOption_Data { - """ - ✨ Generated from Field `ProductOption`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `ProductOption`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr - """ - ✨ Generated from Field `ProductOption`.`productId` of type `UUID!` - """ - productId: UUID - """ - ✨ `_expr` server value variant of `productId` (✨ Generated from Field `ProductOption`.`productId` of type `UUID!`) - """ - productId_expr: UUID_Expr - """ - ✨ Generated from Field `ProductOption`.`product` of type `Product!` - """ - product: Product_Key - """ - ✨ Generated from Field `ProductOption`.`name` of type `String!` - """ - name: String - """ - ✨ `_expr` server value variant of `name` (✨ Generated from Field `ProductOption`.`name` of type `String!`) - """ - name_expr: String_Expr - """ - ✨ Generated from Field `ProductOption`.`values` of type `[String]` - """ - values: [String!] -} -""" -✨ Generated filter input type for table 'ProductOption'. This input allows filtering objects using various conditions. Use `_or`, `_and`, and `_not` to compose complex filters. -""" -input ProductOption_Filter { - """ - Apply multiple filter conditions using `AND` logic. - """ - _and: [ProductOption_Filter!] - """ - Negate the result of the provided filter condition. - """ - _not: ProductOption_Filter - """ - Apply multiple filter conditions using `OR` logic. - """ - _or: [ProductOption_Filter!] - """ - ✨ Generated from Field `ProductOption`.`id` of type `UUID!` - """ - id: UUID_Filter - """ - ✨ Generated from Field `ProductOption`.`productId` of type `UUID!` - """ - productId: UUID_Filter - """ - ✨ Generated from Field `ProductOption`.`product` of type `Product!` - """ - product: Product_Filter - """ - ✨ Generated from Field `ProductOption`.`name` of type `String!` - """ - name: String_Filter - """ - ✨ Generated from Field `ProductOption`.`values` of type `[String]` - """ - values: String_ListFilter -} -""" -✨ Generated first-row input type for table 'ProductOption'. This input selects the first row matching the filter criteria, ordered according to the specified conditions. -""" -input ProductOption_FirstRow { - """ - Order the result by the specified fields. - """ - orderBy: [ProductOption_Order!] - """ - Filters rows based on the specified conditions. - """ - where: ProductOption_Filter -} -""" -✨ Generated key input type for table 'ProductOption'. It represents the primary key fields used to uniquely identify a row in the table. -""" -input ProductOption_Key { - """ - ✨ Generated from Field `ProductOption`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `ProductOption`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr -} -""" -✨ Generated list filter input type for table 'ProductOption'. This input applies filtering logic based on the count or existence of related objects that matches certain criteria. -""" -input ProductOption_ListFilter { - """ - The desired number of objects that match the condition (defaults to at least one). - """ - count: Int_Filter = {gt:0} - """ - Condition of the related objects to filter for. - """ - exist: ProductOption_Filter -} -""" -✨ Generated order input type for table 'ProductOption'. This input defines the sorting order of rows in query results based on one or more fields. -""" -input ProductOption_Order { - """ - ✨ Generated from Field `ProductOption`.`id` of type `UUID!` - """ - id: OrderDirection - """ - ✨ Generated from Field `ProductOption`.`productId` of type `UUID!` - """ - productId: OrderDirection - """ - ✨ Generated from Field `ProductOption`.`product` of type `Product!` - """ - product: Product_Order - """ - ✨ Generated from Field `ProductOption`.`name` of type `String!` - """ - name: OrderDirection -} -""" -✨ Generated data input type for table 'ProductReview'. It includes all necessary fields for creating or upserting rows into table. -""" -input ProductReview_Data { - """ - ✨ Generated from Field `ProductReview`.`productId` of type `UUID!` - """ - productId: UUID - """ - ✨ `_expr` server value variant of `productId` (✨ Generated from Field `ProductReview`.`productId` of type `UUID!`) - """ - productId_expr: UUID_Expr - """ - ✨ Generated from Field `ProductReview`.`customerId` of type `String!` - """ - customerId: String - """ - ✨ `_expr` server value variant of `customerId` (✨ Generated from Field `ProductReview`.`customerId` of type `String!`) - """ - customerId_expr: String_Expr - """ - ✨ Generated from Field `ProductReview`.`customer` of type `Customer!` - """ - customer: Customer_Key - """ - ✨ Generated from Field `ProductReview`.`product` of type `Product!` - """ - product: Product_Key - """ - ✨ Generated from Field `ProductReview`.`content` of type `String!` - """ - content: String - """ - ✨ `_expr` server value variant of `content` (✨ Generated from Field `ProductReview`.`content` of type `String!`) - """ - content_expr: String_Expr - """ - ✨ Generated from Field `ProductReview`.`contentEmbedding` of type `Vector!` - """ - contentEmbedding: Vector - """ - ✨ `_embed` server value variant of `contentEmbedding` (✨ Generated from Field `ProductReview`.`contentEmbedding` of type `Vector!`) - """ - contentEmbedding_embed: Vector_Embed - """ - ✨ Generated from Field `ProductReview`.`date` of type `Date!` - """ - date: Date - """ - ✨ `_date` server value variant of `date` (✨ Generated from Field `ProductReview`.`date` of type `Date!`) - """ - date_date: Date_Relative - """ - ✨ `_expr` server value variant of `date` (✨ Generated from Field `ProductReview`.`date` of type `Date!`) - """ - date_expr: Date_Expr - """ - ✨ Generated from Field `ProductReview`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `ProductReview`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr - """ - ✨ Generated from Field `ProductReview`.`rating` of type `Int!` - """ - rating: Int - """ - ✨ `_expr` server value variant of `rating` (✨ Generated from Field `ProductReview`.`rating` of type `Int!`) - """ - rating_expr: Int_Expr -} -""" -✨ Generated filter input type for table 'ProductReview'. This input allows filtering objects using various conditions. Use `_or`, `_and`, and `_not` to compose complex filters. -""" -input ProductReview_Filter { - """ - Apply multiple filter conditions using `AND` logic. - """ - _and: [ProductReview_Filter!] - """ - Negate the result of the provided filter condition. - """ - _not: ProductReview_Filter - """ - Apply multiple filter conditions using `OR` logic. - """ - _or: [ProductReview_Filter!] - """ - ✨ Generated from Field `ProductReview`.`productId` of type `UUID!` - """ - productId: UUID_Filter - """ - ✨ Generated from Field `ProductReview`.`customerId` of type `String!` - """ - customerId: String_Filter - """ - ✨ Generated from Field `ProductReview`.`customer` of type `Customer!` - """ - customer: Customer_Filter - """ - ✨ Generated from Field `ProductReview`.`product` of type `Product!` - """ - product: Product_Filter - """ - ✨ Generated from Field `ProductReview`.`content` of type `String!` - """ - content: String_Filter - """ - ✨ Generated from Field `ProductReview`.`contentEmbedding` of type `Vector!` - """ - contentEmbedding: Vector_Filter - """ - ✨ Generated from Field `ProductReview`.`date` of type `Date!` - """ - date: Date_Filter - """ - ✨ Generated from Field `ProductReview`.`id` of type `UUID!` - """ - id: UUID_Filter - """ - ✨ Generated from Field `ProductReview`.`rating` of type `Int!` - """ - rating: Int_Filter -} -""" -✨ Generated first-row input type for table 'ProductReview'. This input selects the first row matching the filter criteria, ordered according to the specified conditions. -""" -input ProductReview_FirstRow { - """ - Order the result by the specified fields. - """ - orderBy: [ProductReview_Order!] - """ - Filters rows based on the specified conditions. - """ - where: ProductReview_Filter -} -""" -✨ Generated key input type for table 'ProductReview'. It represents the primary key fields used to uniquely identify a row in the table. -""" -input ProductReview_Key { - """ - ✨ Generated from Field `ProductReview`.`productId` of type `UUID!` - """ - productId: UUID - """ - ✨ `_expr` server value variant of `productId` (✨ Generated from Field `ProductReview`.`productId` of type `UUID!`) - """ - productId_expr: UUID_Expr - """ - ✨ Generated from Field `ProductReview`.`customerId` of type `String!` - """ - customerId: String - """ - ✨ `_expr` server value variant of `customerId` (✨ Generated from Field `ProductReview`.`customerId` of type `String!`) - """ - customerId_expr: String_Expr -} -""" -✨ Generated list filter input type for table 'ProductReview'. This input applies filtering logic based on the count or existence of related objects that matches certain criteria. -""" -input ProductReview_ListFilter { - """ - The desired number of objects that match the condition (defaults to at least one). - """ - count: Int_Filter = {gt:0} - """ - Condition of the related objects to filter for. - """ - exist: ProductReview_Filter -} -""" -✨ Generated order input type for table 'ProductReview'. This input defines the sorting order of rows in query results based on one or more fields. -""" -input ProductReview_Order { - """ - ✨ Generated from Field `ProductReview`.`productId` of type `UUID!` - """ - productId: OrderDirection - """ - ✨ Generated from Field `ProductReview`.`customerId` of type `String!` - """ - customerId: OrderDirection - """ - ✨ Generated from Field `ProductReview`.`customer` of type `Customer!` - """ - customer: Customer_Order - """ - ✨ Generated from Field `ProductReview`.`product` of type `Product!` - """ - product: Product_Order - """ - ✨ Generated from Field `ProductReview`.`content` of type `String!` - """ - content: OrderDirection - """ - ✨ Generated from Field `ProductReview`.`contentEmbedding` of type `Vector!` - """ - contentEmbedding: OrderDirection - """ - ✨ Generated from Field `ProductReview`.`date` of type `Date!` - """ - date: OrderDirection - """ - ✨ Generated from Field `ProductReview`.`id` of type `UUID!` - """ - id: OrderDirection - """ - ✨ Generated from Field `ProductReview`.`rating` of type `Int!` - """ - rating: OrderDirection -} -""" -✨ Generated data input type for table 'ProductVariant'. It includes all necessary fields for creating or upserting rows into table. -""" -input ProductVariant_Data { - """ - ✨ Generated from Field `ProductVariant`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `ProductVariant`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr - """ - ✨ Generated from Field `ProductVariant`.`productId` of type `UUID!` - """ - productId: UUID - """ - ✨ `_expr` server value variant of `productId` (✨ Generated from Field `ProductVariant`.`productId` of type `UUID!`) - """ - productId_expr: UUID_Expr - """ - ✨ Generated from Field `ProductVariant`.`product` of type `Product!` - """ - product: Product_Key - """ - ✨ Generated from Field `ProductVariant`.`availableForSale` of type `Boolean!` - """ - availableForSale: Boolean - """ - ✨ Generated from Field `ProductVariant`.`inventoryQuantity` of type `Int!` - """ - inventoryQuantity: Int - """ - ✨ `_expr` server value variant of `inventoryQuantity` (✨ Generated from Field `ProductVariant`.`inventoryQuantity` of type `Int!`) - """ - inventoryQuantity_expr: Int_Expr - """ - ✨ Generated from Field `ProductVariant`.`price` of type `Float!` - """ - price: Float - """ - ✨ Generated from Field `ProductVariant`.`sku` of type `String` - """ - sku: String - """ - ✨ `_expr` server value variant of `sku` (✨ Generated from Field `ProductVariant`.`sku` of type `String`) - """ - sku_expr: String_Expr - """ - ✨ Generated from Field `ProductVariant`.`title` of type `String!` - """ - title: String - """ - ✨ `_expr` server value variant of `title` (✨ Generated from Field `ProductVariant`.`title` of type `String!`) - """ - title_expr: String_Expr -} -""" -✨ Generated filter input type for table 'ProductVariant'. This input allows filtering objects using various conditions. Use `_or`, `_and`, and `_not` to compose complex filters. -""" -input ProductVariant_Filter { - """ - Apply multiple filter conditions using `AND` logic. - """ - _and: [ProductVariant_Filter!] - """ - Negate the result of the provided filter condition. - """ - _not: ProductVariant_Filter - """ - Apply multiple filter conditions using `OR` logic. - """ - _or: [ProductVariant_Filter!] - """ - ✨ Generated from Field `ProductVariant`.`id` of type `UUID!` - """ - id: UUID_Filter - """ - ✨ Generated from Field `ProductVariant`.`productId` of type `UUID!` - """ - productId: UUID_Filter - """ - ✨ Generated from Field `ProductVariant`.`product` of type `Product!` - """ - product: Product_Filter - """ - ✨ Generated from Field `ProductVariant`.`availableForSale` of type `Boolean!` - """ - availableForSale: Boolean_Filter - """ - ✨ Generated from Field `ProductVariant`.`inventoryQuantity` of type `Int!` - """ - inventoryQuantity: Int_Filter - """ - ✨ Generated from Field `ProductVariant`.`price` of type `Float!` - """ - price: Float_Filter - """ - ✨ Generated from Field `ProductVariant`.`sku` of type `String` - """ - sku: String_Filter - """ - ✨ Generated from Field `ProductVariant`.`title` of type `String!` - """ - title: String_Filter - """ - ✨ Generated from Field `ProductVariant`.`selectedOptions_on_productVariant` of type `[SelectedOption!]!` - """ - selectedOptions_on_productVariant: SelectedOption_ListFilter -} -""" -✨ Generated first-row input type for table 'ProductVariant'. This input selects the first row matching the filter criteria, ordered according to the specified conditions. -""" -input ProductVariant_FirstRow { - """ - Order the result by the specified fields. - """ - orderBy: [ProductVariant_Order!] - """ - Filters rows based on the specified conditions. - """ - where: ProductVariant_Filter -} -""" -✨ Generated key input type for table 'ProductVariant'. It represents the primary key fields used to uniquely identify a row in the table. -""" -input ProductVariant_Key { - """ - ✨ Generated from Field `ProductVariant`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `ProductVariant`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr -} -""" -✨ Generated list filter input type for table 'ProductVariant'. This input applies filtering logic based on the count or existence of related objects that matches certain criteria. -""" -input ProductVariant_ListFilter { - """ - The desired number of objects that match the condition (defaults to at least one). - """ - count: Int_Filter = {gt:0} - """ - Condition of the related objects to filter for. - """ - exist: ProductVariant_Filter -} -""" -✨ Generated order input type for table 'ProductVariant'. This input defines the sorting order of rows in query results based on one or more fields. -""" -input ProductVariant_Order { - """ - ✨ Generated from Field `ProductVariant`.`id` of type `UUID!` - """ - id: OrderDirection - """ - ✨ Generated from Field `ProductVariant`.`productId` of type `UUID!` - """ - productId: OrderDirection - """ - ✨ Generated from Field `ProductVariant`.`product` of type `Product!` - """ - product: Product_Order - """ - ✨ Generated from Field `ProductVariant`.`availableForSale` of type `Boolean!` - """ - availableForSale: OrderDirection - """ - ✨ Generated from Field `ProductVariant`.`inventoryQuantity` of type `Int!` - """ - inventoryQuantity: OrderDirection - """ - ✨ Generated from Field `ProductVariant`.`price` of type `Float!` - """ - price: OrderDirection - """ - ✨ Generated from Field `ProductVariant`.`sku` of type `String` - """ - sku: OrderDirection - """ - ✨ Generated from Field `ProductVariant`.`title` of type `String!` - """ - title: OrderDirection -} -""" -✨ Generated data input type for table 'SEO'. It includes all necessary fields for creating or upserting rows into table. -""" -input SEO_Data { - """ - ✨ Generated from Field `SEO`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `SEO`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr - """ - ✨ Generated from Field `SEO`.`description` of type `String!` - """ - description: String - """ - ✨ `_expr` server value variant of `description` (✨ Generated from Field `SEO`.`description` of type `String!`) - """ - description_expr: String_Expr - """ - ✨ Generated from Field `SEO`.`keywords` of type `String!` - """ - keywords: String - """ - ✨ `_expr` server value variant of `keywords` (✨ Generated from Field `SEO`.`keywords` of type `String!`) - """ - keywords_expr: String_Expr - """ - ✨ Generated from Field `SEO`.`title` of type `String!` - """ - title: String - """ - ✨ `_expr` server value variant of `title` (✨ Generated from Field `SEO`.`title` of type `String!`) - """ - title_expr: String_Expr -} -""" -✨ Generated filter input type for table 'SEO'. This input allows filtering objects using various conditions. Use `_or`, `_and`, and `_not` to compose complex filters. -""" -input SEO_Filter { - """ - Apply multiple filter conditions using `AND` logic. - """ - _and: [SEO_Filter!] - """ - Negate the result of the provided filter condition. - """ - _not: SEO_Filter - """ - Apply multiple filter conditions using `OR` logic. - """ - _or: [SEO_Filter!] - """ - ✨ Generated from Field `SEO`.`id` of type `UUID!` - """ - id: UUID_Filter - """ - ✨ Generated from Field `SEO`.`description` of type `String!` - """ - description: String_Filter - """ - ✨ Generated from Field `SEO`.`keywords` of type `String!` - """ - keywords: String_Filter - """ - ✨ Generated from Field `SEO`.`title` of type `String!` - """ - title: String_Filter - """ - ✨ Generated from Field `SEO`.`collections_on_seo` of type `[Collection!]!` - """ - collections_on_seo: Collection_ListFilter - """ - ✨ Generated from Field `SEO`.`products_on_seo` of type `[Product!]!` - """ - products_on_seo: Product_ListFilter -} -""" -✨ Generated first-row input type for table 'SEO'. This input selects the first row matching the filter criteria, ordered according to the specified conditions. -""" -input SEO_FirstRow { - """ - Order the result by the specified fields. - """ - orderBy: [SEO_Order!] - """ - Filters rows based on the specified conditions. - """ - where: SEO_Filter -} -""" -✨ Generated key input type for table 'SEO'. It represents the primary key fields used to uniquely identify a row in the table. -""" -input SEO_Key { - """ - ✨ Generated from Field `SEO`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `SEO`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr -} -""" -✨ Generated list filter input type for table 'SEO'. This input applies filtering logic based on the count or existence of related objects that matches certain criteria. -""" -input SEO_ListFilter { - """ - The desired number of objects that match the condition (defaults to at least one). - """ - count: Int_Filter = {gt:0} - """ - Condition of the related objects to filter for. - """ - exist: SEO_Filter -} -""" -✨ Generated order input type for table 'SEO'. This input defines the sorting order of rows in query results based on one or more fields. -""" -input SEO_Order { - """ - ✨ Generated from Field `SEO`.`id` of type `UUID!` - """ - id: OrderDirection - """ - ✨ Generated from Field `SEO`.`description` of type `String!` - """ - description: OrderDirection - """ - ✨ Generated from Field `SEO`.`keywords` of type `String!` - """ - keywords: OrderDirection - """ - ✨ Generated from Field `SEO`.`title` of type `String!` - """ - title: OrderDirection -} -""" -✨ Generated data input type for table 'SelectedOption'. It includes all necessary fields for creating or upserting rows into table. -""" -input SelectedOption_Data { - """ - ✨ Generated from Field `SelectedOption`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `SelectedOption`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr - """ - ✨ Generated from Field `SelectedOption`.`productVariantId` of type `UUID!` - """ - productVariantId: UUID - """ - ✨ `_expr` server value variant of `productVariantId` (✨ Generated from Field `SelectedOption`.`productVariantId` of type `UUID!`) - """ - productVariantId_expr: UUID_Expr - """ - ✨ Generated from Field `SelectedOption`.`productVariant` of type `ProductVariant!` - """ - productVariant: ProductVariant_Key - """ - ✨ Generated from Field `SelectedOption`.`name` of type `String` - """ - name: String - """ - ✨ `_expr` server value variant of `name` (✨ Generated from Field `SelectedOption`.`name` of type `String`) - """ - name_expr: String_Expr - """ - ✨ Generated from Field `SelectedOption`.`value` of type `String` - """ - value: String - """ - ✨ `_expr` server value variant of `value` (✨ Generated from Field `SelectedOption`.`value` of type `String`) - """ - value_expr: String_Expr -} -""" -✨ Generated filter input type for table 'SelectedOption'. This input allows filtering objects using various conditions. Use `_or`, `_and`, and `_not` to compose complex filters. -""" -input SelectedOption_Filter { - """ - Apply multiple filter conditions using `AND` logic. - """ - _and: [SelectedOption_Filter!] - """ - Negate the result of the provided filter condition. - """ - _not: SelectedOption_Filter - """ - Apply multiple filter conditions using `OR` logic. - """ - _or: [SelectedOption_Filter!] - """ - ✨ Generated from Field `SelectedOption`.`id` of type `UUID!` - """ - id: UUID_Filter - """ - ✨ Generated from Field `SelectedOption`.`productVariantId` of type `UUID!` - """ - productVariantId: UUID_Filter - """ - ✨ Generated from Field `SelectedOption`.`productVariant` of type `ProductVariant!` - """ - productVariant: ProductVariant_Filter - """ - ✨ Generated from Field `SelectedOption`.`name` of type `String` - """ - name: String_Filter - """ - ✨ Generated from Field `SelectedOption`.`value` of type `String` - """ - value: String_Filter -} -""" -✨ Generated first-row input type for table 'SelectedOption'. This input selects the first row matching the filter criteria, ordered according to the specified conditions. -""" -input SelectedOption_FirstRow { - """ - Order the result by the specified fields. - """ - orderBy: [SelectedOption_Order!] - """ - Filters rows based on the specified conditions. - """ - where: SelectedOption_Filter -} -""" -✨ Generated key input type for table 'SelectedOption'. It represents the primary key fields used to uniquely identify a row in the table. -""" -input SelectedOption_Key { - """ - ✨ Generated from Field `SelectedOption`.`id` of type `UUID!` - """ - id: UUID - """ - ✨ `_expr` server value variant of `id` (✨ Generated from Field `SelectedOption`.`id` of type `UUID!`) - """ - id_expr: UUID_Expr -} -""" -✨ Generated list filter input type for table 'SelectedOption'. This input applies filtering logic based on the count or existence of related objects that matches certain criteria. -""" -input SelectedOption_ListFilter { - """ - The desired number of objects that match the condition (defaults to at least one). - """ - count: Int_Filter = {gt:0} - """ - Condition of the related objects to filter for. - """ - exist: SelectedOption_Filter -} -""" -✨ Generated order input type for table 'SelectedOption'. This input defines the sorting order of rows in query results based on one or more fields. -""" -input SelectedOption_Order { - """ - ✨ Generated from Field `SelectedOption`.`id` of type `UUID!` - """ - id: OrderDirection - """ - ✨ Generated from Field `SelectedOption`.`productVariantId` of type `UUID!` - """ - productVariantId: OrderDirection - """ - ✨ Generated from Field `SelectedOption`.`productVariant` of type `ProductVariant!` - """ - productVariant: ProductVariant_Order - """ - ✨ Generated from Field `SelectedOption`.`name` of type `String` - """ - name: OrderDirection - """ - ✨ Generated from Field `SelectedOption`.`value` of type `String` - """ - value: OrderDirection -} diff --git a/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/mutation.gql b/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/mutation.gql deleted file mode 100644 index dcf08547..00000000 --- a/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/mutation.gql +++ /dev/null @@ -1,1336 +0,0 @@ -extend type Mutation { - """ - ✨ Insert a single `Collection` into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - collection_insert( - """ - Data object to insert into the table. - """ - data: Collection_Data! - ): Collection_KeyOutput! @fdc_generated(from: "Collection", purpose: INSERT_SINGLE) - """ - ✨ Insert a single `Customer` into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - customer_insert( - """ - Data object to insert into the table. - """ - data: Customer_Data! - ): Customer_KeyOutput! @fdc_generated(from: "Customer", purpose: INSERT_SINGLE) - """ - ✨ Insert a single `Order` into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - order_insert( - """ - Data object to insert into the table. - """ - data: Order_Data! - ): Order_KeyOutput! @fdc_generated(from: "Order", purpose: INSERT_SINGLE) - """ - ✨ Insert a single `OrderItem` into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - orderItem_insert( - """ - Data object to insert into the table. - """ - data: OrderItem_Data! - ): OrderItem_KeyOutput! @fdc_generated(from: "OrderItem", purpose: INSERT_SINGLE) - """ - ✨ Insert a single `Product` into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - product_insert( - """ - Data object to insert into the table. - """ - data: Product_Data! - ): Product_KeyOutput! @fdc_generated(from: "Product", purpose: INSERT_SINGLE) - """ - ✨ Insert a single `ProductCollection` into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - productCollection_insert( - """ - Data object to insert into the table. - """ - data: ProductCollection_Data! - ): ProductCollection_KeyOutput! @fdc_generated(from: "ProductCollection", purpose: INSERT_SINGLE) - """ - ✨ Insert a single `ProductImage` into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - productImage_insert( - """ - Data object to insert into the table. - """ - data: ProductImage_Data! - ): ProductImage_KeyOutput! @fdc_generated(from: "ProductImage", purpose: INSERT_SINGLE) - """ - ✨ Insert a single `ProductOption` into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - productOption_insert( - """ - Data object to insert into the table. - """ - data: ProductOption_Data! - ): ProductOption_KeyOutput! @fdc_generated(from: "ProductOption", purpose: INSERT_SINGLE) - """ - ✨ Insert a single `ProductReview` into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - productReview_insert( - """ - Data object to insert into the table. - """ - data: ProductReview_Data! - ): ProductReview_KeyOutput! @fdc_generated(from: "ProductReview", purpose: INSERT_SINGLE) - """ - ✨ Insert a single `ProductVariant` into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - productVariant_insert( - """ - Data object to insert into the table. - """ - data: ProductVariant_Data! - ): ProductVariant_KeyOutput! @fdc_generated(from: "ProductVariant", purpose: INSERT_SINGLE) - """ - ✨ Insert a single `SEO` into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - sEO_insert( - """ - Data object to insert into the table. - """ - data: SEO_Data! - ): SEO_KeyOutput! @fdc_generated(from: "SEO", purpose: INSERT_SINGLE) - """ - ✨ Insert a single `SelectedOption` into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - selectedOption_insert( - """ - Data object to insert into the table. - """ - data: SelectedOption_Data! - ): SelectedOption_KeyOutput! @fdc_generated(from: "SelectedOption", purpose: INSERT_SINGLE) - """ - ✨ Insert `Collection` objects into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - collection_insertMany( - """ - List of data objects to insert into the table. - """ - data: [Collection_Data!]! - ): [Collection_KeyOutput!]! @fdc_generated(from: "Collection", purpose: INSERT_MULTIPLE) - """ - ✨ Insert `Customer` objects into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - customer_insertMany( - """ - List of data objects to insert into the table. - """ - data: [Customer_Data!]! - ): [Customer_KeyOutput!]! @fdc_generated(from: "Customer", purpose: INSERT_MULTIPLE) - """ - ✨ Insert `Order` objects into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - order_insertMany( - """ - List of data objects to insert into the table. - """ - data: [Order_Data!]! - ): [Order_KeyOutput!]! @fdc_generated(from: "Order", purpose: INSERT_MULTIPLE) - """ - ✨ Insert `OrderItem` objects into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - orderItem_insertMany( - """ - List of data objects to insert into the table. - """ - data: [OrderItem_Data!]! - ): [OrderItem_KeyOutput!]! @fdc_generated(from: "OrderItem", purpose: INSERT_MULTIPLE) - """ - ✨ Insert `Product` objects into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - product_insertMany( - """ - List of data objects to insert into the table. - """ - data: [Product_Data!]! - ): [Product_KeyOutput!]! @fdc_generated(from: "Product", purpose: INSERT_MULTIPLE) - """ - ✨ Insert `ProductCollection` objects into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - productCollection_insertMany( - """ - List of data objects to insert into the table. - """ - data: [ProductCollection_Data!]! - ): [ProductCollection_KeyOutput!]! @fdc_generated(from: "ProductCollection", purpose: INSERT_MULTIPLE) - """ - ✨ Insert `ProductImage` objects into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - productImage_insertMany( - """ - List of data objects to insert into the table. - """ - data: [ProductImage_Data!]! - ): [ProductImage_KeyOutput!]! @fdc_generated(from: "ProductImage", purpose: INSERT_MULTIPLE) - """ - ✨ Insert `ProductOption` objects into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - productOption_insertMany( - """ - List of data objects to insert into the table. - """ - data: [ProductOption_Data!]! - ): [ProductOption_KeyOutput!]! @fdc_generated(from: "ProductOption", purpose: INSERT_MULTIPLE) - """ - ✨ Insert `ProductReview` objects into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - productReview_insertMany( - """ - List of data objects to insert into the table. - """ - data: [ProductReview_Data!]! - ): [ProductReview_KeyOutput!]! @fdc_generated(from: "ProductReview", purpose: INSERT_MULTIPLE) - """ - ✨ Insert `ProductVariant` objects into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - productVariant_insertMany( - """ - List of data objects to insert into the table. - """ - data: [ProductVariant_Data!]! - ): [ProductVariant_KeyOutput!]! @fdc_generated(from: "ProductVariant", purpose: INSERT_MULTIPLE) - """ - ✨ Insert `SEO` objects into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - sEO_insertMany( - """ - List of data objects to insert into the table. - """ - data: [SEO_Data!]! - ): [SEO_KeyOutput!]! @fdc_generated(from: "SEO", purpose: INSERT_MULTIPLE) - """ - ✨ Insert `SelectedOption` objects into the table. Columns not specified in `data` will receive defaults (e.g. `null`). - """ - selectedOption_insertMany( - """ - List of data objects to insert into the table. - """ - data: [SelectedOption_Data!]! - ): [SelectedOption_KeyOutput!]! @fdc_generated(from: "SelectedOption", purpose: INSERT_MULTIPLE) - """ - ✨ Insert or update a single `Collection` into the table, based on the primary key. Returns the key of the newly inserted `Collection`. - """ - collection_upsert( - """ - Data object to insert or update if it already exists. - """ - data: Collection_Data! - ): Collection_KeyOutput! @fdc_generated(from: "Collection", purpose: UPSERT_SINGLE) - """ - ✨ Insert or update a single `Customer` into the table, based on the primary key. Returns the key of the newly inserted `Customer`. - """ - customer_upsert( - """ - Data object to insert or update if it already exists. - """ - data: Customer_Data! - ): Customer_KeyOutput! @fdc_generated(from: "Customer", purpose: UPSERT_SINGLE) - """ - ✨ Insert or update a single `Order` into the table, based on the primary key. Returns the key of the newly inserted `Order`. - """ - order_upsert( - """ - Data object to insert or update if it already exists. - """ - data: Order_Data! - ): Order_KeyOutput! @fdc_generated(from: "Order", purpose: UPSERT_SINGLE) - """ - ✨ Insert or update a single `OrderItem` into the table, based on the primary key. Returns the key of the newly inserted `OrderItem`. - """ - orderItem_upsert( - """ - Data object to insert or update if it already exists. - """ - data: OrderItem_Data! - ): OrderItem_KeyOutput! @fdc_generated(from: "OrderItem", purpose: UPSERT_SINGLE) - """ - ✨ Insert or update a single `Product` into the table, based on the primary key. Returns the key of the newly inserted `Product`. - """ - product_upsert( - """ - Data object to insert or update if it already exists. - """ - data: Product_Data! - ): Product_KeyOutput! @fdc_generated(from: "Product", purpose: UPSERT_SINGLE) - """ - ✨ Insert or update a single `ProductCollection` into the table, based on the primary key. Returns the key of the newly inserted `ProductCollection`. - """ - productCollection_upsert( - """ - Data object to insert or update if it already exists. - """ - data: ProductCollection_Data! - ): ProductCollection_KeyOutput! @fdc_generated(from: "ProductCollection", purpose: UPSERT_SINGLE) - """ - ✨ Insert or update a single `ProductImage` into the table, based on the primary key. Returns the key of the newly inserted `ProductImage`. - """ - productImage_upsert( - """ - Data object to insert or update if it already exists. - """ - data: ProductImage_Data! - ): ProductImage_KeyOutput! @fdc_generated(from: "ProductImage", purpose: UPSERT_SINGLE) - """ - ✨ Insert or update a single `ProductOption` into the table, based on the primary key. Returns the key of the newly inserted `ProductOption`. - """ - productOption_upsert( - """ - Data object to insert or update if it already exists. - """ - data: ProductOption_Data! - ): ProductOption_KeyOutput! @fdc_generated(from: "ProductOption", purpose: UPSERT_SINGLE) - """ - ✨ Insert or update a single `ProductReview` into the table, based on the primary key. Returns the key of the newly inserted `ProductReview`. - """ - productReview_upsert( - """ - Data object to insert or update if it already exists. - """ - data: ProductReview_Data! - ): ProductReview_KeyOutput! @fdc_generated(from: "ProductReview", purpose: UPSERT_SINGLE) - """ - ✨ Insert or update a single `ProductVariant` into the table, based on the primary key. Returns the key of the newly inserted `ProductVariant`. - """ - productVariant_upsert( - """ - Data object to insert or update if it already exists. - """ - data: ProductVariant_Data! - ): ProductVariant_KeyOutput! @fdc_generated(from: "ProductVariant", purpose: UPSERT_SINGLE) - """ - ✨ Insert or update a single `SEO` into the table, based on the primary key. Returns the key of the newly inserted `SEO`. - """ - sEO_upsert( - """ - Data object to insert or update if it already exists. - """ - data: SEO_Data! - ): SEO_KeyOutput! @fdc_generated(from: "SEO", purpose: UPSERT_SINGLE) - """ - ✨ Insert or update a single `SelectedOption` into the table, based on the primary key. Returns the key of the newly inserted `SelectedOption`. - """ - selectedOption_upsert( - """ - Data object to insert or update if it already exists. - """ - data: SelectedOption_Data! - ): SelectedOption_KeyOutput! @fdc_generated(from: "SelectedOption", purpose: UPSERT_SINGLE) - """ - ✨ Insert or update `Collection` objects into the table, based on the primary key. Returns the key of the newly inserted `Collection`. - """ - collection_upsertMany( - """ - List of data objects to insert or update if it already exists. - """ - data: [Collection_Data!]! - ): [Collection_KeyOutput!]! @fdc_generated(from: "Collection", purpose: UPSERT_MULTIPLE) - """ - ✨ Insert or update `Customer` objects into the table, based on the primary key. Returns the key of the newly inserted `Customer`. - """ - customer_upsertMany( - """ - List of data objects to insert or update if it already exists. - """ - data: [Customer_Data!]! - ): [Customer_KeyOutput!]! @fdc_generated(from: "Customer", purpose: UPSERT_MULTIPLE) - """ - ✨ Insert or update `Order` objects into the table, based on the primary key. Returns the key of the newly inserted `Order`. - """ - order_upsertMany( - """ - List of data objects to insert or update if it already exists. - """ - data: [Order_Data!]! - ): [Order_KeyOutput!]! @fdc_generated(from: "Order", purpose: UPSERT_MULTIPLE) - """ - ✨ Insert or update `OrderItem` objects into the table, based on the primary key. Returns the key of the newly inserted `OrderItem`. - """ - orderItem_upsertMany( - """ - List of data objects to insert or update if it already exists. - """ - data: [OrderItem_Data!]! - ): [OrderItem_KeyOutput!]! @fdc_generated(from: "OrderItem", purpose: UPSERT_MULTIPLE) - """ - ✨ Insert or update `Product` objects into the table, based on the primary key. Returns the key of the newly inserted `Product`. - """ - product_upsertMany( - """ - List of data objects to insert or update if it already exists. - """ - data: [Product_Data!]! - ): [Product_KeyOutput!]! @fdc_generated(from: "Product", purpose: UPSERT_MULTIPLE) - """ - ✨ Insert or update `ProductCollection` objects into the table, based on the primary key. Returns the key of the newly inserted `ProductCollection`. - """ - productCollection_upsertMany( - """ - List of data objects to insert or update if it already exists. - """ - data: [ProductCollection_Data!]! - ): [ProductCollection_KeyOutput!]! @fdc_generated(from: "ProductCollection", purpose: UPSERT_MULTIPLE) - """ - ✨ Insert or update `ProductImage` objects into the table, based on the primary key. Returns the key of the newly inserted `ProductImage`. - """ - productImage_upsertMany( - """ - List of data objects to insert or update if it already exists. - """ - data: [ProductImage_Data!]! - ): [ProductImage_KeyOutput!]! @fdc_generated(from: "ProductImage", purpose: UPSERT_MULTIPLE) - """ - ✨ Insert or update `ProductOption` objects into the table, based on the primary key. Returns the key of the newly inserted `ProductOption`. - """ - productOption_upsertMany( - """ - List of data objects to insert or update if it already exists. - """ - data: [ProductOption_Data!]! - ): [ProductOption_KeyOutput!]! @fdc_generated(from: "ProductOption", purpose: UPSERT_MULTIPLE) - """ - ✨ Insert or update `ProductReview` objects into the table, based on the primary key. Returns the key of the newly inserted `ProductReview`. - """ - productReview_upsertMany( - """ - List of data objects to insert or update if it already exists. - """ - data: [ProductReview_Data!]! - ): [ProductReview_KeyOutput!]! @fdc_generated(from: "ProductReview", purpose: UPSERT_MULTIPLE) - """ - ✨ Insert or update `ProductVariant` objects into the table, based on the primary key. Returns the key of the newly inserted `ProductVariant`. - """ - productVariant_upsertMany( - """ - List of data objects to insert or update if it already exists. - """ - data: [ProductVariant_Data!]! - ): [ProductVariant_KeyOutput!]! @fdc_generated(from: "ProductVariant", purpose: UPSERT_MULTIPLE) - """ - ✨ Insert or update `SEO` objects into the table, based on the primary key. Returns the key of the newly inserted `SEO`. - """ - sEO_upsertMany( - """ - List of data objects to insert or update if it already exists. - """ - data: [SEO_Data!]! - ): [SEO_KeyOutput!]! @fdc_generated(from: "SEO", purpose: UPSERT_MULTIPLE) - """ - ✨ Insert or update `SelectedOption` objects into the table, based on the primary key. Returns the key of the newly inserted `SelectedOption`. - """ - selectedOption_upsertMany( - """ - List of data objects to insert or update if it already exists. - """ - data: [SelectedOption_Data!]! - ): [SelectedOption_KeyOutput!]! @fdc_generated(from: "SelectedOption", purpose: UPSERT_MULTIPLE) - """ - ✨ Update a single `Collection` based on `id`, `key` or `first`, setting columns specified in `data`. Returns `null` if not found. - """ - collection_update( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: Collection_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: Collection_FirstRow - - """ - Data object containing fields to be updated. - """ - data: Collection_Data! - ): Collection_KeyOutput @fdc_generated(from: "Collection", purpose: UPDATE_SINGLE) - """ - ✨ Update a single `Customer` based on `id`, `key` or `first`, setting columns specified in `data`. Returns `null` if not found. - """ - customer_update( - """ - The unique ID of the object. - """ - id: String - - """ - ✨ `_expr` server value variant of `id` (The unique ID of the object.) - """ - id_expr: String_Expr - - """ - The key used to identify the object. - """ - key: Customer_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: Customer_FirstRow - - """ - Data object containing fields to be updated. - """ - data: Customer_Data! - ): Customer_KeyOutput @fdc_generated(from: "Customer", purpose: UPDATE_SINGLE) - """ - ✨ Update a single `Order` based on `id`, `key` or `first`, setting columns specified in `data`. Returns `null` if not found. - """ - order_update( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: Order_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: Order_FirstRow - - """ - Data object containing fields to be updated. - """ - data: Order_Data! - ): Order_KeyOutput @fdc_generated(from: "Order", purpose: UPDATE_SINGLE) - """ - ✨ Update a single `OrderItem` based on `id`, `key` or `first`, setting columns specified in `data`. Returns `null` if not found. - """ - orderItem_update( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: OrderItem_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: OrderItem_FirstRow - - """ - Data object containing fields to be updated. - """ - data: OrderItem_Data! - ): OrderItem_KeyOutput @fdc_generated(from: "OrderItem", purpose: UPDATE_SINGLE) - """ - ✨ Update a single `Product` based on `id`, `key` or `first`, setting columns specified in `data`. Returns `null` if not found. - """ - product_update( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: Product_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: Product_FirstRow - - """ - Data object containing fields to be updated. - """ - data: Product_Data! - ): Product_KeyOutput @fdc_generated(from: "Product", purpose: UPDATE_SINGLE) - """ - ✨ Update a single `ProductCollection` based on `id`, `key` or `first`, setting columns specified in `data`. Returns `null` if not found. - """ - productCollection_update( - """ - The key used to identify the object. - """ - key: ProductCollection_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductCollection_FirstRow - - """ - Data object containing fields to be updated. - """ - data: ProductCollection_Data! - ): ProductCollection_KeyOutput @fdc_generated(from: "ProductCollection", purpose: UPDATE_SINGLE) - """ - ✨ Update a single `ProductImage` based on `id`, `key` or `first`, setting columns specified in `data`. Returns `null` if not found. - """ - productImage_update( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: ProductImage_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductImage_FirstRow - - """ - Data object containing fields to be updated. - """ - data: ProductImage_Data! - ): ProductImage_KeyOutput @fdc_generated(from: "ProductImage", purpose: UPDATE_SINGLE) - """ - ✨ Update a single `ProductOption` based on `id`, `key` or `first`, setting columns specified in `data`. Returns `null` if not found. - """ - productOption_update( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: ProductOption_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductOption_FirstRow - - """ - Data object containing fields to be updated. - """ - data: ProductOption_Data! - ): ProductOption_KeyOutput @fdc_generated(from: "ProductOption", purpose: UPDATE_SINGLE) - """ - ✨ Update a single `ProductReview` based on `id`, `key` or `first`, setting columns specified in `data`. Returns `null` if not found. - """ - productReview_update( - """ - The key used to identify the object. - """ - key: ProductReview_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductReview_FirstRow - - """ - Data object containing fields to be updated. - """ - data: ProductReview_Data! - ): ProductReview_KeyOutput @fdc_generated(from: "ProductReview", purpose: UPDATE_SINGLE) - """ - ✨ Update a single `ProductVariant` based on `id`, `key` or `first`, setting columns specified in `data`. Returns `null` if not found. - """ - productVariant_update( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: ProductVariant_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductVariant_FirstRow - - """ - Data object containing fields to be updated. - """ - data: ProductVariant_Data! - ): ProductVariant_KeyOutput @fdc_generated(from: "ProductVariant", purpose: UPDATE_SINGLE) - """ - ✨ Update a single `SEO` based on `id`, `key` or `first`, setting columns specified in `data`. Returns `null` if not found. - """ - sEO_update( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: SEO_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: SEO_FirstRow - - """ - Data object containing fields to be updated. - """ - data: SEO_Data! - ): SEO_KeyOutput @fdc_generated(from: "SEO", purpose: UPDATE_SINGLE) - """ - ✨ Update a single `SelectedOption` based on `id`, `key` or `first`, setting columns specified in `data`. Returns `null` if not found. - """ - selectedOption_update( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: SelectedOption_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: SelectedOption_FirstRow - - """ - Data object containing fields to be updated. - """ - data: SelectedOption_Data! - ): SelectedOption_KeyOutput @fdc_generated(from: "SelectedOption", purpose: UPDATE_SINGLE) - """ - ✨ Update `Collection` objects matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. - """ - collection_updateMany( - """ - Filter condition to specify which rows to update. - """ - where: Collection_Filter - - """ - Set to true to update all rows. - """ - all: Boolean = false - - """ - Data object containing fields to update. - """ - data: Collection_Data! - ): Int! @fdc_generated(from: "Collection", purpose: UPDATE_MULTIPLE) - """ - ✨ Update `Customer` objects matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. - """ - customer_updateMany( - """ - Filter condition to specify which rows to update. - """ - where: Customer_Filter - - """ - Set to true to update all rows. - """ - all: Boolean = false - - """ - Data object containing fields to update. - """ - data: Customer_Data! - ): Int! @fdc_generated(from: "Customer", purpose: UPDATE_MULTIPLE) - """ - ✨ Update `Order` objects matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. - """ - order_updateMany( - """ - Filter condition to specify which rows to update. - """ - where: Order_Filter - - """ - Set to true to update all rows. - """ - all: Boolean = false - - """ - Data object containing fields to update. - """ - data: Order_Data! - ): Int! @fdc_generated(from: "Order", purpose: UPDATE_MULTIPLE) - """ - ✨ Update `OrderItem` objects matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. - """ - orderItem_updateMany( - """ - Filter condition to specify which rows to update. - """ - where: OrderItem_Filter - - """ - Set to true to update all rows. - """ - all: Boolean = false - - """ - Data object containing fields to update. - """ - data: OrderItem_Data! - ): Int! @fdc_generated(from: "OrderItem", purpose: UPDATE_MULTIPLE) - """ - ✨ Update `Product` objects matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. - """ - product_updateMany( - """ - Filter condition to specify which rows to update. - """ - where: Product_Filter - - """ - Set to true to update all rows. - """ - all: Boolean = false - - """ - Data object containing fields to update. - """ - data: Product_Data! - ): Int! @fdc_generated(from: "Product", purpose: UPDATE_MULTIPLE) - """ - ✨ Update `ProductCollection` objects matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. - """ - productCollection_updateMany( - """ - Filter condition to specify which rows to update. - """ - where: ProductCollection_Filter - - """ - Set to true to update all rows. - """ - all: Boolean = false - - """ - Data object containing fields to update. - """ - data: ProductCollection_Data! - ): Int! @fdc_generated(from: "ProductCollection", purpose: UPDATE_MULTIPLE) - """ - ✨ Update `ProductImage` objects matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. - """ - productImage_updateMany( - """ - Filter condition to specify which rows to update. - """ - where: ProductImage_Filter - - """ - Set to true to update all rows. - """ - all: Boolean = false - - """ - Data object containing fields to update. - """ - data: ProductImage_Data! - ): Int! @fdc_generated(from: "ProductImage", purpose: UPDATE_MULTIPLE) - """ - ✨ Update `ProductOption` objects matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. - """ - productOption_updateMany( - """ - Filter condition to specify which rows to update. - """ - where: ProductOption_Filter - - """ - Set to true to update all rows. - """ - all: Boolean = false - - """ - Data object containing fields to update. - """ - data: ProductOption_Data! - ): Int! @fdc_generated(from: "ProductOption", purpose: UPDATE_MULTIPLE) - """ - ✨ Update `ProductReview` objects matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. - """ - productReview_updateMany( - """ - Filter condition to specify which rows to update. - """ - where: ProductReview_Filter - - """ - Set to true to update all rows. - """ - all: Boolean = false - - """ - Data object containing fields to update. - """ - data: ProductReview_Data! - ): Int! @fdc_generated(from: "ProductReview", purpose: UPDATE_MULTIPLE) - """ - ✨ Update `ProductVariant` objects matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. - """ - productVariant_updateMany( - """ - Filter condition to specify which rows to update. - """ - where: ProductVariant_Filter - - """ - Set to true to update all rows. - """ - all: Boolean = false - - """ - Data object containing fields to update. - """ - data: ProductVariant_Data! - ): Int! @fdc_generated(from: "ProductVariant", purpose: UPDATE_MULTIPLE) - """ - ✨ Update `SEO` objects matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. - """ - sEO_updateMany( - """ - Filter condition to specify which rows to update. - """ - where: SEO_Filter - - """ - Set to true to update all rows. - """ - all: Boolean = false - - """ - Data object containing fields to update. - """ - data: SEO_Data! - ): Int! @fdc_generated(from: "SEO", purpose: UPDATE_MULTIPLE) - """ - ✨ Update `SelectedOption` objects matching `where` conditions (or `all`, if true) according to `data`. Returns the number of rows updated. - """ - selectedOption_updateMany( - """ - Filter condition to specify which rows to update. - """ - where: SelectedOption_Filter - - """ - Set to true to update all rows. - """ - all: Boolean = false - - """ - Data object containing fields to update. - """ - data: SelectedOption_Data! - ): Int! @fdc_generated(from: "SelectedOption", purpose: UPDATE_MULTIPLE) - """ - ✨ Delete a single `Collection` based on `id`, `key` or `first` and return its key (or `null` if not found). - """ - collection_delete( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: Collection_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: Collection_FirstRow - ): Collection_KeyOutput @fdc_generated(from: "Collection", purpose: DELETE_SINGLE) - """ - ✨ Delete a single `Customer` based on `id`, `key` or `first` and return its key (or `null` if not found). - """ - customer_delete( - """ - The unique ID of the object. - """ - id: String - - """ - ✨ `_expr` server value variant of `id` (The unique ID of the object.) - """ - id_expr: String_Expr - - """ - The key used to identify the object. - """ - key: Customer_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: Customer_FirstRow - ): Customer_KeyOutput @fdc_generated(from: "Customer", purpose: DELETE_SINGLE) - """ - ✨ Delete a single `Order` based on `id`, `key` or `first` and return its key (or `null` if not found). - """ - order_delete( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: Order_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: Order_FirstRow - ): Order_KeyOutput @fdc_generated(from: "Order", purpose: DELETE_SINGLE) - """ - ✨ Delete a single `OrderItem` based on `id`, `key` or `first` and return its key (or `null` if not found). - """ - orderItem_delete( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: OrderItem_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: OrderItem_FirstRow - ): OrderItem_KeyOutput @fdc_generated(from: "OrderItem", purpose: DELETE_SINGLE) - """ - ✨ Delete a single `Product` based on `id`, `key` or `first` and return its key (or `null` if not found). - """ - product_delete( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: Product_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: Product_FirstRow - ): Product_KeyOutput @fdc_generated(from: "Product", purpose: DELETE_SINGLE) - """ - ✨ Delete a single `ProductCollection` based on `id`, `key` or `first` and return its key (or `null` if not found). - """ - productCollection_delete( - """ - The key used to identify the object. - """ - key: ProductCollection_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductCollection_FirstRow - ): ProductCollection_KeyOutput @fdc_generated(from: "ProductCollection", purpose: DELETE_SINGLE) - """ - ✨ Delete a single `ProductImage` based on `id`, `key` or `first` and return its key (or `null` if not found). - """ - productImage_delete( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: ProductImage_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductImage_FirstRow - ): ProductImage_KeyOutput @fdc_generated(from: "ProductImage", purpose: DELETE_SINGLE) - """ - ✨ Delete a single `ProductOption` based on `id`, `key` or `first` and return its key (or `null` if not found). - """ - productOption_delete( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: ProductOption_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductOption_FirstRow - ): ProductOption_KeyOutput @fdc_generated(from: "ProductOption", purpose: DELETE_SINGLE) - """ - ✨ Delete a single `ProductReview` based on `id`, `key` or `first` and return its key (or `null` if not found). - """ - productReview_delete( - """ - The key used to identify the object. - """ - key: ProductReview_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductReview_FirstRow - ): ProductReview_KeyOutput @fdc_generated(from: "ProductReview", purpose: DELETE_SINGLE) - """ - ✨ Delete a single `ProductVariant` based on `id`, `key` or `first` and return its key (or `null` if not found). - """ - productVariant_delete( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: ProductVariant_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductVariant_FirstRow - ): ProductVariant_KeyOutput @fdc_generated(from: "ProductVariant", purpose: DELETE_SINGLE) - """ - ✨ Delete a single `SEO` based on `id`, `key` or `first` and return its key (or `null` if not found). - """ - sEO_delete( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: SEO_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: SEO_FirstRow - ): SEO_KeyOutput @fdc_generated(from: "SEO", purpose: DELETE_SINGLE) - """ - ✨ Delete a single `SelectedOption` based on `id`, `key` or `first` and return its key (or `null` if not found). - """ - selectedOption_delete( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: SelectedOption_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: SelectedOption_FirstRow - ): SelectedOption_KeyOutput @fdc_generated(from: "SelectedOption", purpose: DELETE_SINGLE) - """ - ✨ Delete `Collection` objects matching `where` conditions (or `all`, if true). Returns the number of rows deleted. - """ - collection_deleteMany( - """ - Filter condition to specify which rows to delete. - """ - where: Collection_Filter - - """ - Set to true to delete all rows. - """ - all: Boolean = false - ): Int! @fdc_generated(from: "Collection", purpose: DELETE_MULTIPLE) - """ - ✨ Delete `Customer` objects matching `where` conditions (or `all`, if true). Returns the number of rows deleted. - """ - customer_deleteMany( - """ - Filter condition to specify which rows to delete. - """ - where: Customer_Filter - - """ - Set to true to delete all rows. - """ - all: Boolean = false - ): Int! @fdc_generated(from: "Customer", purpose: DELETE_MULTIPLE) - """ - ✨ Delete `Order` objects matching `where` conditions (or `all`, if true). Returns the number of rows deleted. - """ - order_deleteMany( - """ - Filter condition to specify which rows to delete. - """ - where: Order_Filter - - """ - Set to true to delete all rows. - """ - all: Boolean = false - ): Int! @fdc_generated(from: "Order", purpose: DELETE_MULTIPLE) - """ - ✨ Delete `OrderItem` objects matching `where` conditions (or `all`, if true). Returns the number of rows deleted. - """ - orderItem_deleteMany( - """ - Filter condition to specify which rows to delete. - """ - where: OrderItem_Filter - - """ - Set to true to delete all rows. - """ - all: Boolean = false - ): Int! @fdc_generated(from: "OrderItem", purpose: DELETE_MULTIPLE) - """ - ✨ Delete `Product` objects matching `where` conditions (or `all`, if true). Returns the number of rows deleted. - """ - product_deleteMany( - """ - Filter condition to specify which rows to delete. - """ - where: Product_Filter - - """ - Set to true to delete all rows. - """ - all: Boolean = false - ): Int! @fdc_generated(from: "Product", purpose: DELETE_MULTIPLE) - """ - ✨ Delete `ProductCollection` objects matching `where` conditions (or `all`, if true). Returns the number of rows deleted. - """ - productCollection_deleteMany( - """ - Filter condition to specify which rows to delete. - """ - where: ProductCollection_Filter - - """ - Set to true to delete all rows. - """ - all: Boolean = false - ): Int! @fdc_generated(from: "ProductCollection", purpose: DELETE_MULTIPLE) - """ - ✨ Delete `ProductImage` objects matching `where` conditions (or `all`, if true). Returns the number of rows deleted. - """ - productImage_deleteMany( - """ - Filter condition to specify which rows to delete. - """ - where: ProductImage_Filter - - """ - Set to true to delete all rows. - """ - all: Boolean = false - ): Int! @fdc_generated(from: "ProductImage", purpose: DELETE_MULTIPLE) - """ - ✨ Delete `ProductOption` objects matching `where` conditions (or `all`, if true). Returns the number of rows deleted. - """ - productOption_deleteMany( - """ - Filter condition to specify which rows to delete. - """ - where: ProductOption_Filter - - """ - Set to true to delete all rows. - """ - all: Boolean = false - ): Int! @fdc_generated(from: "ProductOption", purpose: DELETE_MULTIPLE) - """ - ✨ Delete `ProductReview` objects matching `where` conditions (or `all`, if true). Returns the number of rows deleted. - """ - productReview_deleteMany( - """ - Filter condition to specify which rows to delete. - """ - where: ProductReview_Filter - - """ - Set to true to delete all rows. - """ - all: Boolean = false - ): Int! @fdc_generated(from: "ProductReview", purpose: DELETE_MULTIPLE) - """ - ✨ Delete `ProductVariant` objects matching `where` conditions (or `all`, if true). Returns the number of rows deleted. - """ - productVariant_deleteMany( - """ - Filter condition to specify which rows to delete. - """ - where: ProductVariant_Filter - - """ - Set to true to delete all rows. - """ - all: Boolean = false - ): Int! @fdc_generated(from: "ProductVariant", purpose: DELETE_MULTIPLE) - """ - ✨ Delete `SEO` objects matching `where` conditions (or `all`, if true). Returns the number of rows deleted. - """ - sEO_deleteMany( - """ - Filter condition to specify which rows to delete. - """ - where: SEO_Filter - - """ - Set to true to delete all rows. - """ - all: Boolean = false - ): Int! @fdc_generated(from: "SEO", purpose: DELETE_MULTIPLE) - """ - ✨ Delete `SelectedOption` objects matching `where` conditions (or `all`, if true). Returns the number of rows deleted. - """ - selectedOption_deleteMany( - """ - Filter condition to specify which rows to delete. - """ - where: SelectedOption_Filter - - """ - Set to true to delete all rows. - """ - all: Boolean = false - ): Int! @fdc_generated(from: "SelectedOption", purpose: DELETE_MULTIPLE) -} diff --git a/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/query.gql b/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/query.gql deleted file mode 100644 index da937566..00000000 --- a/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/query.gql +++ /dev/null @@ -1,618 +0,0 @@ -extend type Query { - """ - ✨ Look up a single `Collection` based on `id`, `key` or `first` and return selected fields (or `null` if not found). - """ - collection( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: Collection_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: Collection_FirstRow - ): Collection @fdc_generated(from: "Collection", purpose: QUERY_SINGLE) - """ - ✨ Look up a single `Customer` based on `id`, `key` or `first` and return selected fields (or `null` if not found). - """ - customer( - """ - The unique ID of the object. - """ - id: String - - """ - ✨ `_expr` server value variant of `id` (The unique ID of the object.) - """ - id_expr: String_Expr - - """ - The key used to identify the object. - """ - key: Customer_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: Customer_FirstRow - ): Customer @fdc_generated(from: "Customer", purpose: QUERY_SINGLE) - """ - ✨ Look up a single `Order` based on `id`, `key` or `first` and return selected fields (or `null` if not found). - """ - order( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: Order_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: Order_FirstRow - ): Order @fdc_generated(from: "Order", purpose: QUERY_SINGLE) - """ - ✨ Look up a single `OrderItem` based on `id`, `key` or `first` and return selected fields (or `null` if not found). - """ - orderItem( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: OrderItem_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: OrderItem_FirstRow - ): OrderItem @fdc_generated(from: "OrderItem", purpose: QUERY_SINGLE) - """ - ✨ Look up a single `Product` based on `id`, `key` or `first` and return selected fields (or `null` if not found). - """ - product( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: Product_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: Product_FirstRow - ): Product @fdc_generated(from: "Product", purpose: QUERY_SINGLE) - """ - ✨ Look up a single `ProductCollection` based on `id`, `key` or `first` and return selected fields (or `null` if not found). - """ - productCollection( - """ - The key used to identify the object. - """ - key: ProductCollection_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductCollection_FirstRow - ): ProductCollection @fdc_generated(from: "ProductCollection", purpose: QUERY_SINGLE) - """ - ✨ Look up a single `ProductImage` based on `id`, `key` or `first` and return selected fields (or `null` if not found). - """ - productImage( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: ProductImage_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductImage_FirstRow - ): ProductImage @fdc_generated(from: "ProductImage", purpose: QUERY_SINGLE) - """ - ✨ Look up a single `ProductOption` based on `id`, `key` or `first` and return selected fields (or `null` if not found). - """ - productOption( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: ProductOption_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductOption_FirstRow - ): ProductOption @fdc_generated(from: "ProductOption", purpose: QUERY_SINGLE) - """ - ✨ Look up a single `ProductReview` based on `id`, `key` or `first` and return selected fields (or `null` if not found). - """ - productReview( - """ - The key used to identify the object. - """ - key: ProductReview_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductReview_FirstRow - ): ProductReview @fdc_generated(from: "ProductReview", purpose: QUERY_SINGLE) - """ - ✨ Look up a single `ProductVariant` based on `id`, `key` or `first` and return selected fields (or `null` if not found). - """ - productVariant( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: ProductVariant_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: ProductVariant_FirstRow - ): ProductVariant @fdc_generated(from: "ProductVariant", purpose: QUERY_SINGLE) - """ - ✨ Look up a single `SEO` based on `id`, `key` or `first` and return selected fields (or `null` if not found). - """ - sEO( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: SEO_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: SEO_FirstRow - ): SEO @fdc_generated(from: "SEO", purpose: QUERY_SINGLE) - """ - ✨ Look up a single `SelectedOption` based on `id`, `key` or `first` and return selected fields (or `null` if not found). - """ - selectedOption( - """ - The unique ID of the object. - """ - id: UUID - - """ - The key used to identify the object. - """ - key: SelectedOption_Key - - """ - Fetch the first row based on the filters and ordering. - """ - first: SelectedOption_FirstRow - ): SelectedOption @fdc_generated(from: "SelectedOption", purpose: QUERY_SINGLE) - """ - ✨ List `Collection` objects in the table, optionally filtered by `where` conditions. - """ - collections( - """ - Filter condition to narrow down the query results. - """ - where: Collection_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [Collection_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [Collection!]! @fdc_generated(from: "Collection", purpose: QUERY_MULTIPLE) - """ - ✨ List `Customer` objects in the table, optionally filtered by `where` conditions. - """ - customers( - """ - Filter condition to narrow down the query results. - """ - where: Customer_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [Customer_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [Customer!]! @fdc_generated(from: "Customer", purpose: QUERY_MULTIPLE) - """ - ✨ List `Order` objects in the table, optionally filtered by `where` conditions. - """ - orders( - """ - Filter condition to narrow down the query results. - """ - where: Order_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [Order_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [Order!]! @fdc_generated(from: "Order", purpose: QUERY_MULTIPLE) - """ - ✨ List `OrderItem` objects in the table, optionally filtered by `where` conditions. - """ - orderItems( - """ - Filter condition to narrow down the query results. - """ - where: OrderItem_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [OrderItem_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [OrderItem!]! @fdc_generated(from: "OrderItem", purpose: QUERY_MULTIPLE) - """ - ✨ List `Product` objects in the table, optionally filtered by `where` conditions. - """ - products( - """ - Filter condition to narrow down the query results. - """ - where: Product_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [Product_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [Product!]! @fdc_generated(from: "Product", purpose: QUERY_MULTIPLE) - """ - ✨ List `ProductCollection` objects in the table, optionally filtered by `where` conditions. - """ - productCollections( - """ - Filter condition to narrow down the query results. - """ - where: ProductCollection_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductCollection_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [ProductCollection!]! @fdc_generated(from: "ProductCollection", purpose: QUERY_MULTIPLE) - """ - ✨ List `ProductImage` objects in the table, optionally filtered by `where` conditions. - """ - productImages( - """ - Filter condition to narrow down the query results. - """ - where: ProductImage_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductImage_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [ProductImage!]! @fdc_generated(from: "ProductImage", purpose: QUERY_MULTIPLE) - """ - ✨ List `ProductOption` objects in the table, optionally filtered by `where` conditions. - """ - productOptions( - """ - Filter condition to narrow down the query results. - """ - where: ProductOption_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductOption_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [ProductOption!]! @fdc_generated(from: "ProductOption", purpose: QUERY_MULTIPLE) - """ - ✨ List `ProductReview` objects in the table, optionally filtered by `where` conditions. - """ - productReviews( - """ - Filter condition to narrow down the query results. - """ - where: ProductReview_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductReview_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [ProductReview!]! @fdc_generated(from: "ProductReview", purpose: QUERY_MULTIPLE) - """ - ✨ List `ProductVariant` objects in the table, optionally filtered by `where` conditions. - """ - productVariants( - """ - Filter condition to narrow down the query results. - """ - where: ProductVariant_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductVariant_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [ProductVariant!]! @fdc_generated(from: "ProductVariant", purpose: QUERY_MULTIPLE) - """ - ✨ List `SEO` objects in the table, optionally filtered by `where` conditions. - """ - sEOS( - """ - Filter condition to narrow down the query results. - """ - where: SEO_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [SEO_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [SEO!]! @fdc_generated(from: "SEO", purpose: QUERY_MULTIPLE) - """ - ✨ List `SelectedOption` objects in the table, optionally filtered by `where` conditions. - """ - selectedOptions( - """ - Filter condition to narrow down the query results. - """ - where: SelectedOption_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [SelectedOption_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [SelectedOption!]! @fdc_generated(from: "SelectedOption", purpose: QUERY_MULTIPLE) - """ - ✨ List `Product` objects ordered by vector similarity between the `descriptionEmbedding` field and `compare_embed`. - (Alternatively, `compare` can be used if the input is a raw Vector.) - """ - products_descriptionEmbedding_similarity( - """ - Vector to compare with the stored vectors. - """ - compare: Vector - - """ - ✨ `_embed` server value variant of `compare` (Vector to compare with the stored vectors.) - """ - compare_embed: Vector_Embed - - """ - Similarity method to use for vector comparison (defaults to `INNER_PRODUCT`). - """ - method: VectorSimilarityMethod = INNER_PRODUCT - - """ - Threshold for distance comparison. - """ - within: Float - - """ - Filter condition to apply when searching for similar vectors. - """ - where: Product_Filter - - """ - Limit the number of similar vectors returned (defaults to 100 rows). - """ - limit: Int = 100 - ): [Product!]! @fdc_generated(from: "Product.descriptionEmbedding", purpose: QUERY_MULTIPLE_BY_SIMILARITY) - """ - ✨ List `Product` objects ordered by vector similarity between the `titleEmbedding` field and `compare_embed`. - (Alternatively, `compare` can be used if the input is a raw Vector.) - """ - products_titleEmbedding_similarity( - """ - Vector to compare with the stored vectors. - """ - compare: Vector - - """ - ✨ `_embed` server value variant of `compare` (Vector to compare with the stored vectors.) - """ - compare_embed: Vector_Embed - - """ - Similarity method to use for vector comparison (defaults to `INNER_PRODUCT`). - """ - method: VectorSimilarityMethod = INNER_PRODUCT - - """ - Threshold for distance comparison. - """ - within: Float - - """ - Filter condition to apply when searching for similar vectors. - """ - where: Product_Filter - - """ - Limit the number of similar vectors returned (defaults to 100 rows). - """ - limit: Int = 100 - ): [Product!]! @fdc_generated(from: "Product.titleEmbedding", purpose: QUERY_MULTIPLE_BY_SIMILARITY) - """ - ✨ List `ProductReview` objects ordered by vector similarity between the `contentEmbedding` field and `compare_embed`. - (Alternatively, `compare` can be used if the input is a raw Vector.) - """ - productReviews_contentEmbedding_similarity( - """ - Vector to compare with the stored vectors. - """ - compare: Vector - - """ - ✨ `_embed` server value variant of `compare` (Vector to compare with the stored vectors.) - """ - compare_embed: Vector_Embed - - """ - Similarity method to use for vector comparison (defaults to `INNER_PRODUCT`). - """ - method: VectorSimilarityMethod = INNER_PRODUCT - - """ - Threshold for distance comparison. - """ - within: Float - - """ - Filter condition to apply when searching for similar vectors. - """ - where: ProductReview_Filter - - """ - Limit the number of similar vectors returned (defaults to 100 rows). - """ - limit: Int = 100 - ): [ProductReview!]! @fdc_generated(from: "ProductReview.contentEmbedding", purpose: QUERY_MULTIPLE_BY_SIMILARITY) -} diff --git a/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/relation.gql b/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/relation.gql deleted file mode 100644 index d6e778b4..00000000 --- a/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/main/relation.gql +++ /dev/null @@ -1,528 +0,0 @@ -extend type Collection { - """ - ✨ List `ProductCollection` objects in a one-to-many relationship (where `ProductCollection`.`collection` is this object). - """ - productCollections_on_collection( - """ - Filter condition to narrow down the query results. - """ - where: ProductCollection_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductCollection_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [ProductCollection!]! @fdc_generated(from: "ProductCollection.collection", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - ✨ List `Product` objects using `ProductCollection` as the join table (a `ProductCollection` object exists where its `collection` is this and its `product` is that). - """ - products_via_ProductCollection( - """ - Filter condition to narrow down the query results. - """ - where: ProductCollection_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductCollection_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [Product!]! @fdc_generated(from: "ProductCollection", purpose: QUERY_MULTIPLE_MANY_TO_MANY) - """ - Implicit metadata field that cannot be written. It provides extra information about query results. - """ - _metadata: _Metadata @fdc_generated(from: "Collection", purpose: METADATA_FIELD) -} -extend type Customer { - """ - ✨ List `Order` objects in a one-to-many relationship (where `Order`.`customer` is this object). - """ - orders_on_customer( - """ - Filter condition to narrow down the query results. - """ - where: Order_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [Order_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [Order!]! @fdc_generated(from: "Order.customer", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - ✨ List `ProductReview` objects in a one-to-many relationship (where `ProductReview`.`customer` is this object). - """ - productReviews_on_customer( - """ - Filter condition to narrow down the query results. - """ - where: ProductReview_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductReview_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [ProductReview!]! @fdc_generated(from: "ProductReview.customer", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - ✨ List `Product` objects using `ProductReview` as the join table (a `ProductReview` object exists where its `customer` is this and its `product` is that). - """ - products_via_ProductReview( - """ - Filter condition to narrow down the query results. - """ - where: ProductReview_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductReview_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [Product!]! @fdc_generated(from: "ProductReview", purpose: QUERY_MULTIPLE_MANY_TO_MANY) - """ - Implicit metadata field that cannot be written. It provides extra information about query results. - """ - _metadata: _Metadata @fdc_generated(from: "Customer", purpose: METADATA_FIELD) -} -extend type Order { - """ - ✨ List `OrderItem` objects in a one-to-many relationship (where `OrderItem`.`order` is this object). - """ - orderItems_on_order( - """ - Filter condition to narrow down the query results. - """ - where: OrderItem_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [OrderItem_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [OrderItem!]! @fdc_generated(from: "OrderItem.order", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - Implicit metadata field that cannot be written. It provides extra information about query results. - """ - _metadata: _Metadata @fdc_generated(from: "Order", purpose: METADATA_FIELD) -} -extend type OrderItem { - """ - Implicit metadata field that cannot be written. It provides extra information about query results. - """ - _metadata: _Metadata @fdc_generated(from: "OrderItem", purpose: METADATA_FIELD) -} -extend type Product { - """ - ✨ List `OrderItem` objects in a one-to-many relationship (where `OrderItem`.`product` is this object). - """ - orderItems_on_product( - """ - Filter condition to narrow down the query results. - """ - where: OrderItem_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [OrderItem_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [OrderItem!]! @fdc_generated(from: "OrderItem.product", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - ✨ List `ProductCollection` objects in a one-to-many relationship (where `ProductCollection`.`product` is this object). - """ - productCollections_on_product( - """ - Filter condition to narrow down the query results. - """ - where: ProductCollection_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductCollection_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [ProductCollection!]! @fdc_generated(from: "ProductCollection.product", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - ✨ List `ProductImage` objects in a one-to-many relationship (where `ProductImage`.`product` is this object). - """ - productImages_on_product( - """ - Filter condition to narrow down the query results. - """ - where: ProductImage_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductImage_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [ProductImage!]! @fdc_generated(from: "ProductImage.product", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - ✨ List `ProductOption` objects in a one-to-many relationship (where `ProductOption`.`product` is this object). - """ - productOptions_on_product( - """ - Filter condition to narrow down the query results. - """ - where: ProductOption_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductOption_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [ProductOption!]! @fdc_generated(from: "ProductOption.product", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - ✨ List `ProductReview` objects in a one-to-many relationship (where `ProductReview`.`product` is this object). - """ - productReviews_on_product( - """ - Filter condition to narrow down the query results. - """ - where: ProductReview_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductReview_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [ProductReview!]! @fdc_generated(from: "ProductReview.product", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - ✨ List `ProductVariant` objects in a one-to-many relationship (where `ProductVariant`.`product` is this object). - """ - productVariants_on_product( - """ - Filter condition to narrow down the query results. - """ - where: ProductVariant_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductVariant_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [ProductVariant!]! @fdc_generated(from: "ProductVariant.product", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - ✨ List `Collection` objects using `ProductCollection` as the join table (a `ProductCollection` object exists where its `product` is this and its `collection` is that). - """ - collections_via_ProductCollection( - """ - Filter condition to narrow down the query results. - """ - where: ProductCollection_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductCollection_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [Collection!]! @fdc_generated(from: "ProductCollection", purpose: QUERY_MULTIPLE_MANY_TO_MANY) - """ - ✨ List `Customer` objects using `ProductReview` as the join table (a `ProductReview` object exists where its `product` is this and its `customer` is that). - """ - customers_via_ProductReview( - """ - Filter condition to narrow down the query results. - """ - where: ProductReview_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [ProductReview_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [Customer!]! @fdc_generated(from: "ProductReview", purpose: QUERY_MULTIPLE_MANY_TO_MANY) - """ - Implicit metadata field that cannot be written. It provides extra information about query results. - """ - _metadata: _Metadata @fdc_generated(from: "Product", purpose: METADATA_FIELD) -} -extend type ProductCollection { - """ - Implicit metadata field that cannot be written. It provides extra information about query results. - """ - _metadata: _Metadata @fdc_generated(from: "ProductCollection", purpose: METADATA_FIELD) -} -extend type ProductImage { - """ - ✨ List `Collection` objects in a one-to-many relationship (where `Collection`.`featuredImage` is this object). - """ - collections_on_featuredImage( - """ - Filter condition to narrow down the query results. - """ - where: Collection_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [Collection_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [Collection!]! @fdc_generated(from: "Collection.featuredImage", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - ✨ List `Product` objects in a one-to-many relationship (where `Product`.`featuredImage` is this object). - """ - products_on_featuredImage( - """ - Filter condition to narrow down the query results. - """ - where: Product_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [Product_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [Product!]! @fdc_generated(from: "Product.featuredImage", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - Implicit metadata field that cannot be written. It provides extra information about query results. - """ - _metadata: _Metadata @fdc_generated(from: "ProductImage", purpose: METADATA_FIELD) -} -extend type ProductOption { - """ - Implicit metadata field that cannot be written. It provides extra information about query results. - """ - _metadata: _Metadata @fdc_generated(from: "ProductOption", purpose: METADATA_FIELD) -} -extend type ProductReview { - """ - Implicit metadata field that cannot be written. It provides extra information about query results. - """ - _metadata: _Metadata @fdc_generated(from: "ProductReview", purpose: METADATA_FIELD) -} -extend type ProductVariant { - """ - ✨ List `SelectedOption` objects in a one-to-many relationship (where `SelectedOption`.`productVariant` is this object). - """ - selectedOptions_on_productVariant( - """ - Filter condition to narrow down the query results. - """ - where: SelectedOption_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [SelectedOption_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [SelectedOption!]! @fdc_generated(from: "SelectedOption.productVariant", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - Implicit metadata field that cannot be written. It provides extra information about query results. - """ - _metadata: _Metadata @fdc_generated(from: "ProductVariant", purpose: METADATA_FIELD) -} -extend type SEO { - """ - ✨ List `Collection` objects in a one-to-many relationship (where `Collection`.`seo` is this object). - """ - collections_on_seo( - """ - Filter condition to narrow down the query results. - """ - where: Collection_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [Collection_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [Collection!]! @fdc_generated(from: "Collection.seo", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - ✨ List `Product` objects in a one-to-many relationship (where `Product`.`seo` is this object). - """ - products_on_seo( - """ - Filter condition to narrow down the query results. - """ - where: Product_Filter - - """ - Order the query results by specific fields. - """ - orderBy: [Product_Order!] - - """ - Number of rows to skip before starting to return the results. - """ - offset: Int - - """ - Maximum number of rows to return (defaults to 100 rows). - """ - limit: Int = 100 - ): [Product!]! @fdc_generated(from: "Product.seo", purpose: QUERY_MULTIPLE_ONE_TO_MANY) - """ - Implicit metadata field that cannot be written. It provides extra information about query results. - """ - _metadata: _Metadata @fdc_generated(from: "SEO", purpose: METADATA_FIELD) -} -extend type SelectedOption { - """ - Implicit metadata field that cannot be written. It provides extra information about query results. - """ - _metadata: _Metadata @fdc_generated(from: "SelectedOption", purpose: METADATA_FIELD) -} diff --git a/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/prelude.gql b/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/prelude.gql deleted file mode 100644 index b8f87f7a..00000000 --- a/starters/nextjs/firebase-ecommerce/dataconnect/.dataconnect/schema/prelude.gql +++ /dev/null @@ -1,2067 +0,0 @@ -""" -Redact a part of the response from the client. - -Redacted fields are still evaluated for side effects (including data changes and -`@check`) and the results are still available to later steps in CEL expressions -(via `response.fieldName`). -""" -directive @redact on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT - -""" -Ensure this field is present and is not null or `[]`, or abort the request / transaction. - -A CEL expression, `expr` is used to test the field value. It defaults to -rejecting null and `[]` but a custom expression can be provided instead. - -If the field occurs multiple times (i.e. directly or indirectly nested under a -list), `expr` will be executed once for each occurrence and `@check` succeeds if -all values succeed. `@check` fails when the field is not present at all (i.e. -all ancestor paths contain `null` or `[]`), unless `optional` is true. - -If a `@check` fails in a mutation, the top-level field containing it will be -replaced with a partial error, whose message can be customzied via the `message` -argument. Each subsequent top-level fields will return an aborted error (i.e. -not executed). To rollback previous steps, see `@transaction`. -""" -directive @check( - """ - The CEL expression to test the field value (or values if nested under a list). - - Within the CEL expression, a special value `this` evaluates to the field that - this directive is attached to. If this field occurs multiple times because - any ancestor is a list, each occurrence is tested with `this` bound to each - value. When the field itself is a list or object, `this` follows the same - structure (including all descendants selected in case of objects). - - For any given path, if an ancestor is `null` or `[]`, the field will not be - reached and the CEL evaluation will be skipped for that path. In other words, - evaluation only takes place when `this` is `null` or non-null, but never - undefined. (See also the `optional` argument.) - """ - expr: Boolean_Expr! = "!(this in [null, []])" - """ - The error message to return to the client if the check fails. - - Defaults to "permission denied" if not specified. - """ - message: String! = "permission denied" - """ - Whether the check should pass or fail (default) when the field is not present. - - A field will not be reached at a given path if its parent or any ancestor is - `[]` or `null`. When this happens to all paths, the field will not be present - anywhere in the response tree. In other words, `expr` is evaluated 0 times. - By default, @check will automatically fail in this case. Set this argument to - `true` to make it pass even if no tests are run (a.k.a. "vacuously true"). - """ - optional: Boolean = false -) repeatable on QUERY | MUTATION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT - -"AccessLevel specifies coarse access policies for common situations." -enum AccessLevel { - """ - This operation is accessible to anyone, with or without authentication. - Equivalent to: `@auth(expr: "true")` - """ - PUBLIC - - """ - This operation can be executed only with a valid Firebase Auth ID token. - **Note:** This access level allows anonymous and unverified accounts, - which may present security and abuse risks. - Equivalent to: `@auth(expr: "auth.uid != nil")` - """ - USER_ANON - - """ - This operation is restricted to non-anonymous Firebase Auth accounts. - Equivalent to: `@auth(expr: "auth.uid != nil && auth.token.firebase.sign_in_provider != 'anonymous'")` - """ - USER - - """ - This operation is restricted to Firebase Auth accounts with verified email addresses. - Equivalent to: `@auth(expr: "auth.uid != nil && auth.token.email_verified")` - """ - USER_EMAIL_VERIFIED - - """ - This operation cannot be executed by anyone. The operation can only be performed - by using the Admin SDK from a privileged environment. - Equivalent to: `@auth(expr: "false")` - """ - NO_ACCESS -} - -""" -The `@auth` directive defines the authentication policy for a query or mutation. - -It must be added to any operation that you wish to be accessible from a client -application. If not specified, the operation defaults to `@auth(level: NO_ACCESS)`. - -Refer to [Data Connect Auth Guide](https://firebase.google.com/docs/data-connect/authorization-and-security) for the best practices. -""" -directive @auth( - """ - The minimal level of access required to perform this operation. - Exactly one of `level` and `expr` should be specified. - """ - level: AccessLevel @fdc_oneOf(required: true) - """ - A CEL expression that grants access to this operation if the expression - evaluates to `true`. - Exactly one of `level` and `expr` should be specified. - """ - expr: Boolean_Expr @fdc_oneOf(required: true) -) on QUERY | MUTATION - - -""" -Require that this mutation always run in a DB transaction. - -Mutations with `@transaction` are guaranteed to either fully succeed or fully -fail. If any of the fields within the transaction fails, the entire transaction -is rolled back. From a client standpoint, any failure behaves as if the entire -request had failed with a request error and execution had not begun. - -Mutations without `@transaction` would execute each root field one after -another in sequence. It surfaces any errors as partial [field errors](https://spec.graphql.org/October2021/#sec-Errors.Field-errors), -but not impacts the subsequent executions. - -The `@transaction` directive cannot be added to queries for now. -Currently, queries cannot fail partially, the response data is not guaranteed -to be a consistent snapshot. -""" -directive @transaction on MUTATION - -"Query filter criteria for `String` scalar fields." -input String_Filter { - "When true, match if field `IS NULL`. When false, match if field is `NOT NULL`." - isNull: Boolean - "Match if field is exactly equal to provided value." - eq: String @fdc_oneOf(group: "eq") - """ - Match if field is exactly equal to the result of the provided server value - expression. Currently only `auth.uid` is supported as an expression. - """ - eq_expr: String_Expr @fdc_oneOf(group: "eq") - "Match if field is not equal to provided value." - ne: String @fdc_oneOf(group: "ne") - """ - Match if field is not equal to the result of the provided server value - expression. Currently only `auth.uid` is supported as an expression. - """ - ne_expr: String_Expr @fdc_oneOf(group: "ne") - "Match if field value is among the provided list of values." - in: [String!] - "Match if field value is not among the provided list of values." - nin: [String!] - "Match if field value is greater than the provided value." - gt: String - "Match if field value is greater than or equal to the provided value." - ge: String - "Match if field value is less than the provided value." - lt: String - "Match if field value is less than or equal to the provided value." - le: String - """ - Match if field value contains the provided value as a substring. Equivalent - to `LIKE '%value%'` - """ - contains: String - """ - Match if field value starts with the provided value. Equivalent to - `LIKE 'value%'` - """ - startsWith: String - """ - Match if field value ends with the provided value. Equivalent to - `LIKE '%value'` - """ - endsWith: String -} - -"Query filter criteris for `[String!]` scalar fields." -input String_ListFilter { - "Match if list field contains the provided value as a member." - includes: String - "Match if list field does not contain the provided value as a member." - excludes: String - "Match if list field contains all of the provided values as members." - includesAll: [String!] - "Match if list field does not contain any of the provided values as members." - excludesAll: [String!] -} - -"Query filter criteria for `UUID` scalar fields." -input UUID_Filter { - "When true, match if field `IS NULL`. When false, match if field is `NOT NULL`." - isNull: Boolean - "Match if field is exactly equal to provided value." - eq: UUID - "Match if field is not equal to provided value." - ne: UUID - "Match if field value is among the provided list of values." - in: [UUID!] - "Match if field value is not among the provided list of values." - nin: [UUID!] -} - -"Query filter criteris for `[UUID!]` scalar fields." -input UUID_ListFilter { - "Match if list field contains the provided value as a member." - includes: UUID - "Match if list field does not contain the provided value as a member." - excludes: UUID - "Match if list field contains all of the provided values as members." - includesAll: [UUID!] - "Match if list field does not contain any of the provided values as members." - excludesAll: [UUID!] -} - -"Query filter criteria for `Int` scalar fields." -input Int_Filter { - "When true, match if field `IS NULL`. When false, match if field is `NOT NULL`." - isNull: Boolean - "Match if field is exactly equal to provided value." - eq: Int - """ - Match if field is exactly equal to the result of the provided server value - expression. - """ - eq_expr: Int_Expr @fdc_oneOf(group: "eq") - "Match if field is not equal to provided value." - ne: Int - """ - Match if field is not equal to the result of the provided server value - expression. - """ - ne_expr: Int_Expr @fdc_oneOf(group: "ne") - "Match if field value is among the provided list of values." - in: [Int!] - "Match if field value is not among the provided list of values." - nin: [Int!] - "Match if field value is greater than the provided value." - gt: Int - """ - Match if field value is greater than the result of the provided server value - expression. - """ - gt_expr: Int_Expr @fdc_oneOf(group: "gt") - "Match if field value is greater than or equal to the provided value." - ge: Int - """ - Match if field value is greater than or equal to the result of the provided - server value expression. - """ - ge_expr: Int_Expr @fdc_oneOf(group: "ge") - "Match if field value is less than the provided value." - lt: Int - """ - Match if field value is less than the result of the provided server value - expression. - """ - lt_expr: Int_Expr @fdc_oneOf(group: "lt") - "Match if field value is less than or equal to the provided value." - le: Int - """ - Match if field value is less than or equal to the result of the provided - server value expression. - """ - le_expr: Int_Expr @fdc_oneOf(group: "le") -} - -"Query filter criteris for `[Int!]` scalar fields." -input Int_ListFilter { - "Match if list field contains the provided value as a member." - includes: Int - "Match if list field does not contain the provided value as a member." - excludes: Int - "Match if list field contains all of the provided values as members." - includesAll: [Int!] - "Match if list field does not contain any of the provided values as members." - excludesAll: [Int!] -} - -"Query filter criteria for `Int64` scalar fields." -input Int64_Filter { - "When true, match if field `IS NULL`. When false, match if field is `NOT NULL`." - isNull: Boolean - "Match if field is exactly equal to provided value." - eq: Int64 - "Match if field is not equal to provided value." - ne: Int64 - "Match if field value is among the provided list of values." - in: [Int64!] - "Match if field value is not among the provided list of values." - nin: [Int64!] - "Match if field value is greater than the provided value." - gt: Int64 - "Match if field value is greater than or equal to the provided value." - ge: Int64 - "Match if field value is less than the provided value." - lt: Int64 - "Match if field value is less than or equal to the provided value." - le: Int64 -} - -"Query filter criteria for `[Int64!]` scalar fields." -input Int64_ListFilter { - "Match if list field contains the provided value as a member." - includes: Int64 - "Match if list field does not contain the provided value as a member." - excludes: Int64 - "Match if list field contains all of the provided values as members." - includesAll: [Int64!] - "Match if list field does not contain any of the provided values as members." - excludesAll: [Int64!] -} - -"Query filter criteria for `Float` scalar fields." -input Float_Filter { - "When true, match if field `IS NULL`. When false, match if field is `NOT NULL`." - isNull: Boolean - "Match if field is exactly equal to provided value." - eq: Float - "Match if field is not equal to provided value." - ne: Float - "Match if field value is among the provided list of values." - in: [Float!] - "Match if field value is not among the provided list of values." - nin: [Float!] - "Match if field value is greater than the provided value." - gt: Float - "Match if field value is greater than or equal to the provided value." - ge: Float - "Match if field value is less than the provided value." - lt: Float - "Match if field value is less than or equal to the provided value." - le: Float -} - -"Query filter criteria for `[Float!]` scalar fields." -input Float_ListFilter { - "Match if list field contains the provided value as a member." - includes: Float - "Match if list field does not contain the provided value as a member." - excludes: Float - "Match if list field contains all of the provided values as members." - includesAll: [Float!] - "Match if list field does not contain any of the provided values as members." - excludesAll: [Float!] -} - -"Query filter criteria for `Boolean` scalar fields." -input Boolean_Filter { - "When true, match if field `IS NULL`. When false, match if field is `NOT NULL`." - isNull: Boolean - "Match if field is exactly equal to provided value." - eq: Boolean - "Match if field is not equal to provided value." - ne: Boolean - "Match if field value is among the provided list of values." - in: [Boolean!] - "Match if field value is not among the provided list of values." - nin: [Boolean!] -} - -"Query filter criteria for `[Boolean!]` scalar fields." -input Boolean_ListFilter { - "Match if list field contains the provided value as a member." - includes: Boolean - "Match if list field does not contain the provided value as a member." - excludes: Boolean - "Match if list field contains all of the provided values as members." - includesAll: [Boolean!] - "Match if list field does not contain any of the provided values as members." - excludesAll: [Boolean!] -} - -"Query filter criteria for `Any` scalar fields." -input Any_Filter { - "When true, match if field `IS NULL`. When false, match if field is `NOT NULL`." - isNull: Boolean - "Match if field is exactly equal to provided value." - eq: Any - "Match if field is not equal to provided value." - ne: Any - "Match if field value is among the provided list of values." - in: [Any!] - "Match if field value is not among the provided list of values." - nin: [Any!] -} - -"Query filter criteria for `[Any!]` scalar fields." -input Any_ListFilter { - "Match if list field contains the provided value as a member." - includes: Any - "Match if list field does not contain the provided value as a member." - excludes: Any - "Match if list field contains all of the provided values as members." - includesAll: [Any!] - "Match if list field does not contain any of the provided values as members." - excludesAll: [Any!] -} - -""" -(Internal) A string that uniquely identifies a type, field, and so on. - -The most common usage in FDC is `SomeType` or `SomeType.someField`. See the -linked page in the @specifiedBy directive for the GraphQL RFC with more details. -""" -scalar SchemaCoordinate - @specifiedBy(url: "https://github.com/graphql/graphql-wg/blob/6d02705dea034fb65ebc6799632adb7bd550d0aa/rfcs/SchemaCoordinates.md") - @fdc_forbiddenAsFieldType - @fdc_forbiddenAsVariableType - -"(Internal) The purpose of a generated type or field." -enum GeneratedPurpose { - # Implicit fields added to the table types as columns. - IMPLICIT_KEY_FIELD - IMPLICIT_REF_FIELD - - # Generated static fields extended to table types. - METADATA_FIELD - - # Relational non-column fields extended to table types. - QUERY_MULTIPLE_ONE_TO_MANY - QUERY_MULTIPLE_MANY_TO_MANY - - # Generated fields for aggregates - QUERY_COUNT - QUERY_SUM - QUERY_AVG - QUERY_MIN - QUERY_MAX - - # Top-level Query fields. - QUERY_SINGLE - QUERY_MULTIPLE - QUERY_MULTIPLE_BY_SIMILARITY - - # Top-level Mutation fields. - INSERT_SINGLE - INSERT_MULTIPLE - UPSERT_SINGLE - UPSERT_MULTIPLE - UPDATE_SINGLE - UPDATE_MULTIPLE - DELETE_SINGLE - DELETE_MULTIPLE -} - -"(Internal) Added to definitions generated by FDC." -directive @fdc_generated( - "The source type or field that causes this definition to be generated." - from: SchemaCoordinate! - "The reason why this definition is generated, such as the intended use case." - purpose: GeneratedPurpose! -) on - | SCALAR - | OBJECT - | FIELD_DEFINITION - | ARGUMENT_DEFINITION - | INTERFACE - | UNION - | ENUM - | ENUM_VALUE - | INPUT_OBJECT - | INPUT_FIELD_DEFINITION - -type _Service { - "Full Service Definition Language of the Frebase Data Connect Schema, including normalized schema, predefined and generated types." - sdl( - """ - Whether or not to omit Data Connect builtin GraphQL preludes. - They are static GraphQL publically available in the docsite. - """ - omitBuiltin: Boolean = false - """ - Whether or not to omit GQL description in the SDL. - We generate description to document generated schema. - It may bloat the size of SDL. - """ - omitDescription: Boolean = false - ): String! - "Orignal Schema Sources in the service." - schema: String! - "Generated documentation from the schema of the Firebase Data Connect Service." - docs: [_Doc!]! -} - -type _Doc { - "Name of the Doc Page." - page: String! - "The markdown content of the doc page." - markdown: String! -} - -"(Internal) Added to things that may be removed from FDC and will soon be no longer usable in schema or operations." -directive @fdc_deprecated(reason: String = "No longer supported") on - | SCHEMA - | SCALAR - | OBJECT - | FIELD_DEFINITION - | ARGUMENT_DEFINITION - | INTERFACE - | UNION - | ENUM - | ENUM_VALUE - | INPUT_OBJECT - | INPUT_FIELD_DEFINITION - -"(Internal) Added to scalars representing quoted CEL expressions." -directive @fdc_celExpression( - "The expected CEL type that the expression should evaluate to." - returnType: String -) on SCALAR - -"(Internal) Added to scalars representing quoted SQL expressions." -directive @fdc_sqlExpression( - "The expected SQL type that the expression should evaluate to." - dataType: String -) on SCALAR - -"(Internal) Added to types that may not be used as variables." -directive @fdc_forbiddenAsVariableType on SCALAR | OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT - -"(Internal) Added to types that may not be used as fields in schema." -directive @fdc_forbiddenAsFieldType on SCALAR | OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT - -"Provides a frequently used example for this type / field / argument." -directive @fdc_example( - "A GraphQL literal value (verbatim) whose type matches the target." - value: Any - "A human-readable text description of what `value` means in this context." - description: String -) repeatable on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | INPUT_OBJECT | INPUT_FIELD_DEFINITION - -"(Internal) Marks this field / argument as conflicting with others in the same group." -directive @fdc_oneOf( - "The group name where fields / arguments conflict with each other." - group: String! = "" - "If true, exactly one field / argument in the group must be specified." - required: Boolean! = false -) repeatable on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION - -type Mutation { - """ - Run a query during the mutation and add fields into the response. - - Example: foo: query { users { id } } will add a field foo: {users: [{id: "..."}, …]} into the response JSON. - - Note: Data fetched this way can be handy for permission checks. See @check. - """ - query: Query -} - -""" -`UUID` is a string of hexadecimal digits representing an RFC4122-compliant UUID. - -UUIDs are always output as 32 lowercase hexadecimal digits without delimiters or -curly braces. -Inputs in the following formats are also accepted (case insensitive): - -- `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` -- `urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` -- `{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}` - -In the PostgreSQL table, it's stored as [`uuid`](https://www.postgresql.org/docs/current/datatype-uuid.html). -""" -scalar UUID @specifiedBy(url: "https://tools.ietf.org/html/rfc4122") - -""" -`Int64` is a scalar that represents a 64-bit signed integer. - -In the PostgreSQL table, it's stored as [`bigint`](https://www.postgresql.org/docs/current/datatype-numeric.html). - -On the wire, it's encoded as string because 64-bit integer exceeds the range of JSON number. -""" -scalar Int64 - -""" -The `Any` scalar type accommodates any valid [JSON value](https://www.json.org/json-en.html) -(e.g., numbers, strings, booleans, arrays, objects). PostgreSQL efficiently -stores this data as jsonb, providing flexibility for schemas with evolving structures. - -Caution: JSON doesn't distinguish Int and Float. - -##### Example: - -#### Schema - -```graphql -type Movie @table { - name: String! - metadata: Any! -} -``` - -#### Mutation - -Insert a movie with name and metadata from JSON literal. - -```graphql -mutation InsertMovie { - movie_insert( - data: { - name: "The Dark Knight" - metadata: { - release_year: 2008 - genre: ["Action", "Adventure", "Superhero"] - cast: [ - { name: "Christopher Bale", age: 31 } - { name: "Heath Ledger", age: 28 } - ] - director: "Christopher Nolan" - } - } - ) -} -``` - -Insert a movie with name and metadata that's constructed from a few GQL variables. - -```graphql -mutation InsertMovie($name: String!, $releaseDate: Date!, $genre: [String], $cast: [Any], $director: String!, $boxOfficeInUSD: Int) { - movie_insert(data: { - name: $name, - release_date: $releaseDate, - genre: $genre, - cast: $cast, - director: $director, - box_office: $boxOfficeInUSD - }) -} -``` -**Note**: - - - A mix of non-null and nullable variables can be provided. - - - `Date!` can be passed into scalar `Any` as well! It's stored as string. - - - `$cast` is a nested array. `[Any]` can represent an array of arbitrary types, but it won't enforce the input shape. - -#### Query - -Since `metadata` field has scalar `Any` type, it would return the full JSON in the response. - -**Note**: You can't define selection set to scalar based on [GraphQL spec](https://spec.graphql.org/October2021/#sec-Field-Selections). - -```graphql -query GetAllMovies { - movies { - name - metadata - } -} -``` - -""" -scalar Any @specifiedBy(url: "https://www.json.org/json-en.html") - -""" -The `Void` scalar type represents the absence of any value. It is typically used -in operations where no value is expected in return. -""" -scalar Void - -""" -The `True` scalar type only accepts the boolean value `true`. - -An optional field/argument typed as `True` may either be set -to `true` or omitted (not provided at all). The values `false` or `null` are not -accepted. -""" -scalar True - @fdc_forbiddenAsFieldType - @fdc_forbiddenAsVariableType - @fdc_example(value: true, description: "The only allowed value.") - -""" -A Common Expression Language (CEL) expression that returns a boolean at runtime. - -This expression can reference the `auth` variable, which is null when Firebase -Auth is not used. When Firebase Auth is used, the following fields are available: - - - `auth.uid`: The current user ID. - - `auth.token`: A map containing all token fields (e.g., claims). - -""" -scalar Boolean_Expr - @specifiedBy(url: "https://github.com/google/cel-spec") - @fdc_celExpression(returnType: "bool") - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType - @fdc_example(value: "auth != null", description: "Allow only if a Firebase Auth user is present.") - -""" -A Common Expression Language (CEL) expression that returns a string at runtime. - -**Limitation**: Currently, only a limited set of expressions are supported. -""" -scalar String_Expr - @specifiedBy(url: "https://github.com/google/cel-spec") - @fdc_celExpression(returnType: "string") - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType - @fdc_example(value: "auth.uid", description: "The ID of the currently logged in user in Firebase Auth. (Errors if not logged in.)") - @fdc_example(value: "uuidV4()", description: "Generates a new random UUID (version 4) string, formatted as 32 lower-case hex digits without delimiters.") - -""" -A Common Expression Language (CEL) expression that returns a UUID string at runtime. - -**Limitation**: Currently, only a limited set of expressions are supported. -""" -scalar UUID_Expr - @specifiedBy(url: "https://github.com/google/cel-spec") - @fdc_celExpression(returnType: "string") - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType - @fdc_example(value: "uuidV4()", description: "Generates a new random UUID (version 4) every time.") - -""" -A Common Expression Language (CEL) expression that returns a Int at runtime. - -**Limitation**: Currently, only a limited set of expressions are supported. -""" -scalar Int_Expr - @specifiedBy(url: "https://github.com/google/cel-spec") - @fdc_celExpression(returnType: "int") - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType - @fdc_example(value: "2 * 4", description: "Evaluates to 8.") - @fdc_example(value: "vars.foo.size()", description: "Assuming `vars.foo` is a string, it will evaluate to the length of the string.") -""" -A Common Expression Language (CEL) expression whose return type is unspecified. - -**Limitation**: Only a limited set of expressions are currently supported for each -type. -""" -scalar Any_Expr - @specifiedBy(url: "https://github.com/google/cel-spec") - @fdc_celExpression - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType - @fdc_example(value: "auth.uid", description: "The ID of the currently logged in user in Firebase Auth. (Errors if not logged in.)") - @fdc_example(value: "uuidV4()", description: "Generates a new random UUID version 4 (formatted as 32 lower-case hex digits without delimiters if result type is String).") - @fdc_example(value: "request.time", description: "The timestamp when the request is received (with microseconds precision).") - -""" -A PostgreSQL value expression whose return type is unspecified. -""" -scalar Any_SQL - @specifiedBy(url: "https://www.postgresql.org/docs/current/sql-expressions.html") - @fdc_sqlExpression - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType - -""" -Defines a relational database table. - -In this example, we defined one table with a field named `myField`. - -```graphql -type TableName @table { - myField: String -} -``` -Data Connect adds an implicit `id` primary key column. So the above schema is equivalent to: - -```graphql -type TableName @table(key: "id") { - id: String @default(expr: "uuidV4()") - myField: String -} -``` - -Data Connect generates the following SQL table and CRUD operations to use it. - -```sql -CREATE TABLE "public"."table_name" ( - "id" uuid NOT NULL DEFAULT uuid_generate_v4(), - "my_field" text NULL, - PRIMARY KEY ("id") -) -``` - - * You can lookup a row: `query ($id: UUID!) { tableName(id: $id) { myField } } ` - * You can find rows using: `query tableNames(limit: 20) { myField }` - * You can insert a row: `mutation { tableName_insert(data: {myField: "foo"}) }` - * You can update a row: `mutation ($id: UUID!) { tableName_update(id: $id, data: {myField: "bar"}) }` - * You can delete a row: `mutation ($id: UUID!) { tableName_delete(id: $id) }` - -##### Customizations - -- `@table(singular)` and `@table(plural)` can customize the singular and plural name. -- `@table(name)` can customize the Postgres table name. -- `@table(key)` can customize the primary key field name and type. - -For example, the `User` table often has a `uid` as its primary key. - -```graphql -type User @table(key: "uid") { - uid: String! - name: String -} -``` - - * You can securely lookup a row: `query { user(key: {uid_expr: "auth.uid"}) { name } } ` - * You can securely insert a row: `mutation { user_insert(data: {uid_expr: "auth.uid" name: "Fred"}) }` - * You can securely update a row: `mutation { user_update(key: {uid_expr: "auth.uid"}, data: {name: "New Name"}) }` - * You can securely delete a row: `mutation { user_delete(key: {uid_expr: "auth.uid"}) }` - -`@table` type can be configured further with: - - - Custom SQL data types for columns. See `@col`. - - Add SQL indexes. See `@index`. - - Add SQL unique constraints. See `@unique`. - - Add foreign key constraints to define relations. See `@ref`. - -""" -directive @table( - """ - Configures the SQL database table name. Defaults to snake_case like `table_name`. - """ - name: String - """ - Configures the singular name. Defaults to the camelCase like `tableName`. - """ - singular: String - """ - Configures the plural name. Defaults to infer based on English plural pattern like `tableNames`. - """ - plural: String - """ - Defines the primary key of the table. Defaults to a single field named `id`. - If not present already, Data Connect adds an implicit field `id: UUID! @default(expr: "uuidV4()")`. - """ - key: [String!] -) on OBJECT - -""" -Defines a relational database Raw SQLview. - -Data Connect generates GraphQL queries with WHERE and ORDER BY clauses. -However, not all SQL features has native GraphQL equivalent. - -You can write **an arbitrary SQL SELECT statement**. Data Connect -would map Graphql fields on `@view` type to columns in your SELECT statement. - -* Scalar GQL fields (camelCase) should match a SQL column (snake_case) - in the SQL SELECT statement. -* Reference GQL field can point to another `@table` type. Similar to foreign key - defined with `@ref` on a `@table` type, a `@view` type establishes a relation - when `@ref(fields)` match `@ref(references)` on the target table. - -In this example, you can use `@view(sql)` to define an aggregation view on existing -table. - -```graphql -type User @table { - name: String - score: Int -} -type UserAggregation @view(sql: ''' - SELECT - COUNT(*) as count, - SUM(score) as sum, - AVG(score) as average, - PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY score) AS median, - (SELECT id FROM "user" LIMIT 1) as example_id - FROM "user" -''') { - count: Int - sum: Int - average: Float - median: Float - example: User - exampleId: UUID -} -``` - -###### Example: Query Raw SQL View - -```graphql -query { - userAggregations { - count sum average median - exampleId example { id } - } -} -``` - -##### One-to-One View - -An one-to-one companion `@view` can be handy if you want to argument a `@table` -with additional implied content. - -```graphql -type Restaurant @table { - name: String! -} -type Review @table { - restaurant: Restaurant! - rating: Int! -} -type RestaurantStats @view(sql: ''' - SELECT - restaurant_id, - COUNT(*) AS review_count, - AVG(rating) AS average_rating - FROM review - GROUP BY restaurant_id -''') { - restaurant: Restaurant @unique - reviewCount: Int - averageRating: Float -} -``` - -In this example, `@unique` convey the assumption that each `Restaurant` should -have only one `RestaurantStats` object. - -###### Example: Query One-to-One View - -```graphql -query ListRestaurants { - restaurants { - name - stats: restaurantStats_on_restaurant { - reviewCount - averageRating - } - } -} -``` - -###### Example: Filter based on One-to-One View - -```graphql -query BestRestaurants($minAvgRating: Float, $minReviewCount: Int) { - restaurants(where: { - restaurantStats_on_restaurant: { - averageRating: {ge: $minAvgRating} - reviewCount: {ge: $minReviewCount} - } - }) { name } -} -``` - -##### Customizations - -- One of `@view(sql)` or `@view(name)` should be defined. - `@view(name)` can refer to a persisted SQL view in the Postgres schema. -- `@view(singular)` and `@view(plural)` can customize the singular and plural name. - -`@view` type can be configured further: - - - `@unique` lets you define one-to-one relation. - - `@col` lets you customize SQL column mapping. For example, `@col(name: "column_in_select")`. - -##### Limitations - -Raw SQL view doesn't have a primary key, so it doesn't support lookup. Other -`@table` or `@view` cannot have `@ref` to a view either. - -View cannot be mutated. You can perform CRUD operations on the underlying -table to alter its content. - -**Important: Data Connect doesn't parse and validate SQL** - -- If the SQL view is invalid or undefined, related requests may fail. -- If the SQL view return incompatible types. Firebase Data Connect may surface - errors. -- If a field doesn't have a corresponding column in the SQL SELECT statement, - it will always be `null`. -- There is no way to ensure VIEW to TABLE `@ref` constraint. -- All fields must be nullable in case they aren't found in the SELECT statement - or in the referenced table. - -**Important: You should always test `@view`!** - -""" -directive @view( - """ - The SQL view name. If neither `name` nor `sql` are provided, defaults to the - snake_case of the singular type name. - `name` and `sql` cannot be specified at the same time. - """ - name: String @fdc_oneOf - """ - SQL `SELECT` statement used as the basis for this type. - SQL SELECT columns should use snake_case. GraphQL fields should use camelCase. - `name` and `sql` cannot be specified at the same time. - """ - sql: String @fdc_oneOf - """ - Configures the singular name. Defaults to the camelCase like `viewName`. - """ - singular: String - """ - Configures the plural name. Defaults to infer based on English plural pattern like `viewNames`. - """ - plural: String -) on OBJECT - -""" -Customizes a field that represents a SQL database table column. - -Data Connect maps scalar Fields on `@table` type to a SQL column of -corresponding data type. - -- scalar `UUID` maps to [`uuid`](https://www.postgresql.org/docs/current/datatype-uuid.html). -- scalar `String` maps to [`text`](https://www.postgresql.org/docs/current/datatype-character.html). -- scalar `Int` maps to [`int`](https://www.postgresql.org/docs/current/datatype-numeric.html). -- scalar `Int64` maps to [`bigint`](https://www.postgresql.org/docs/current/datatype-numeric.html). -- scalar `Float` maps to [`double precision`](https://www.postgresql.org/docs/current/datatype-numeric.html). -- scalar `Boolean` maps to [`boolean`](https://www.postgresql.org/docs/current/datatype-boolean.html). -- scalar `Date` maps to [`date`](https://www.postgresql.org/docs/current/datatype-datetime.html). -- scalar `Timestamp` maps to [`timestamptz`](https://www.postgresql.org/docs/current/datatype-datetime.html). -- scalar `Any` maps to [`jsonb`](https://www.postgresql.org/docs/current/datatype-json.html). -- scalar `Vector` maps to [`pgvector`](https://github.com/pgvector/pgvector). - -Array scalar fields are mapped to [Postgres arrays](https://www.postgresql.org/docs/current/arrays.html). - -###### Example: Serial Primary Key - -For example, you can define auto-increment primary key. - -```graphql -type Post @table { - id: Int! @col(name: "post_id", dataType: "serial") -} -``` - -Data Connect converts it to the following SQL table schema. - -```sql -CREATE TABLE "public"."post" ( - "post_id" serial NOT NULL, - PRIMARY KEY ("id") -) -``` - -###### Example: Vector - -```graphql -type Post @table { - content: String! @col(name: "post_content") - contentEmbedding: Vector! @col(size:768) -} -``` - -""" -directive @col( - """ - The SQL database column name. Defaults to snake_case of the field name. - """ - name: String - """ - Configures the custom SQL data type. - - Each GraphQL type can map to multiple SQL data types. - Refer to [Postgres supported data types](https://www.postgresql.org/docs/current/datatype.html). - - Incompatible SQL data type will lead to undefined behavior. - """ - dataType: String - """ - Required on `Vector` columns. It specifies the length of the Vector. - `textembedding-gecko@003` model generates `Vector` of `@col(size:768)`. - """ - size: Int -) on FIELD_DEFINITION - - -""" -Defines a foreign key reference to another table. - -For example, we can define a many-to-one relation. - -```graphql -type ManyTable @table { - refField: OneTable! -} -type OneTable @table { - someField: String! -} -``` -Data Connect adds implicit foreign key column and relation query field. So the -above schema is equivalent to the following schema. - -```graphql -type ManyTable @table { - id: UUID! @default(expr: "uuidV4()") - refField: OneTable! @ref(fields: "refFieldId", references: "id") - refFieldId: UUID! -} -type OneTable @table { - id: UUID! @default(expr: "uuidV4()") - someField: UUID! - # Generated Fields: - # manyTables_on_refField: [ManyTable!]! -} -``` -Data Connect generates the necessary foreign key constraint. - -```sql -CREATE TABLE "public"."many_table" ( - "id" uuid NOT NULL DEFAULT uuid_generate_v4(), - "ref_field_id" uuid NOT NULL, - PRIMARY KEY ("id"), - CONSTRAINT "many_table_ref_field_id_fkey" FOREIGN KEY ("ref_field_id") REFERENCES "public"."one_table" ("id") ON DELETE CASCADE -) -``` - -###### Example: Traverse the Reference Field - -```graphql -query ($id: UUID!) { - manyTable(id: $id) { - refField { id } - } -} -``` - -###### Example: Reverse Traverse the Reference field - -```graphql -query ($id: UUID!) { - oneTable(id: $id) { - manyTables_on_refField { id } - } -} -``` - -##### Optional Many-to-One Relation - -An optional foreign key reference will be set to null if the referenced row is deleted. - -In this example, if a `User` is deleted, the `assignee` and `reporter` -references will be set to null. - -```graphql -type Bug @table { - title: String! - assignee: User - reproter: User -} - -type User @table { name: String! } -``` - -##### Required Many-to-One Relation - -A required foreign key reference will cascade delete if the referenced row is -deleted. - -In this example, if a `Post` is deleted, associated comments will also be -deleted. - -```graphql -type Comment @table { - post: Post! - content: String! -} - -type Post @table { title: String! } -``` - -##### Many To Many Relation - -You can define a many-to-many relation with a join table. - -```graphql -type Membership @table(key: ["group", "user"]) { - group: Group! - user: User! - role: String! @default(value: "member") -} - -type Group @table { name: String! } -type User @table { name: String! } -``` - -When Data Connect sees a table with two reference field as its primary key, it -knows this is a join table, so expands the many-to-many query field. - -```graphql -type Group @table { - name: String! - # Generated Fields: - # users_via_Membership: [User!]! - # memberships_on_group: [Membership!]! -} -type User @table { - name: String! - # Generated Fields: - # groups_via_Membership: [Group!]! - # memberships_on_user: [Membership!]! -} -``` - -###### Example: Traverse the Many-To-Many Relation - -```graphql -query ($id: UUID!) { - group(id: $id) { - users: users_via_Membership { - name - } - } -} -``` - -###### Example: Traverse to the Join Table - -```graphql -query ($id: UUID!) { - group(id: $id) { - memberships: memberships_on_group { - user { name } - role - } - } -} -``` - -##### One To One Relation - -You can even define a one-to-one relation with the help of `@unique` or `@table(key)`. - -```graphql -type User @table { - name: String -} -type Account @table { - user: User! @unique -} -# Alternatively, use primary key constraint. -# type Account @table(key: "user") { -# user: User! -# } -``` - -###### Example: Transerse the Reference Field - -```graphql -query ($id: UUID!) { - account(id: $id) { - user { id } - } -} -``` - -###### Example: Reverse Traverse the Reference field - -```graphql -query ($id: UUID!) { - user(id: $id) { - account_on_user { id } - } -} -``` - -##### Customizations - -- `@ref(constraintName)` can customize the SQL foreign key constraint name (`table_name_ref_field_fkey` above). -- `@ref(fields)` can customize the foreign key field names. -- `@ref(references)` can customize the constraint to reference other columns. - By default, `@ref(references)` is the primary key of the `@ref` table. - Other fields with `@unique` may also be referred in the foreign key constraint. - -""" -directive @ref( - "The SQL database foreign key constraint name. Defaults to snake_case `{table_name}_{field_name}_fkey`." - constraintName: String - """ - Foreign key fields. Defaults to `{tableName}{PrimaryIdName}`. - """ - fields: [String!] - "The fields that the foreign key references in the other table. Defaults to its primary key." - references: [String!] -) on FIELD_DEFINITION - -"Defines the orderBy direction in a query." -enum OrderDirection { -"Results are ordered in ascending order." - ASC -"Results are ordered in descending order." - DESC -} - -""" -Specifies the default value for a column field. - -For example: - -```graphql -type User @table(key: "uid") { - uid: String! @default(expr: "auth.uid") - number: Int! @col(dataType: "serial") - createdAt: Date! @default(expr: "request.time") - role: String! @default(value: "Member") - credit: Int! @default(value: 100) -} -``` - -The supported arguments vary based on the field type. -""" -directive @default( - "A constant value validated against the field's GraphQL type during compilation." - value: Any @fdc_oneOf(required: true) - "A CEL expression whose return value must match the field's data type." - expr: Any_Expr @fdc_oneOf(required: true) - """ - A raw SQL expression, whose SQL data type must match the underlying column. - - The value is any variable-free expression (in particular, cross-references to - other columns in the current table are not allowed). Subqueries are not allowed either. - See [PostgreSQL defaults](https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-PARMS-DEFAULT) - for more details. - """ - sql: Any_SQL @fdc_oneOf(required: true) -) on FIELD_DEFINITION - -""" -Defines a database index to optimize query performance. - -```graphql -type User @table @index(fields: ["name", "phoneNumber"], order: [ASC, DESC]) { - name: String @index - phoneNumber: Int64 @index - tags: [String] @index # GIN Index -} -``` - -##### Single Field Index - -You can put `@index` on a `@col` field to create a SQL index. - -`@index(order)` matters little for single field indexes, as they can be scanned -in both directions. - -##### Composite Index - -You can put `@index(fields: [...])` on `@table` type to define composite indexes. - -`@index(order: [...])` can customize the index order to satisfy particular -filter and order requirement. - -""" -directive @index( - """ - Configure the SQL database index id. - - If not overridden, Data Connect generates the index name: - - `{table_name}_{first_field}_{second_field}_aa_idx` - - `{table_name}_{field_name}_idx` - """ - name: String - """ - Only allowed and required when used on a `@table` type. - Specifies the fields to create the index on. - """ - fields: [String!] - """ - Only allowed for `BTREE` `@index` on `@table` type. - Specifies the order for each indexed column. Defaults to all `ASC`. - """ - order: [IndexFieldOrder!] - """ - Customize the index type. - - For most index, it defaults to `BTREE`. - For array fields, only allowed `IndexType` is `GIN`. - For `Vector` fields, defaults to `HNSW`, may configure to `IVFFLAT`. - """ - type: IndexType - """ - Only allowed when used on vector field. - Defines the vector similarity method. Defaults to `INNER_PRODUCT`. - """ - vector_method: VectorSimilarityMethod -) repeatable on FIELD_DEFINITION | OBJECT - -"Specifies the sorting order for database indexes." -enum IndexFieldOrder { - "Sorts the field in ascending order (from lowest to highest)." - ASC - "Sorts the field in descending order (from highest to lowest)." - DESC -} - -"Defines the type of index to be used in the database." -enum IndexType { - "A general-purpose index type commonly used for sorting and searching." - BTREE - "Generalized Inverted Index, optimized for indexing composite values such as arrays." - GIN - "Hierarchical Navigable Small World graph, used for nearest-neighbor searches on vector fields." - HNSW - "Inverted File Index, optimized for approximate nearest-neighbor searches in vector databases." - IVFFLAT -} - -""" -Defines unique constraints on `@table`. - -For example, - -```graphql -type User @table { - phoneNumber: Int64 @unique -} -type UserProfile @table { - user: User! @unique - address: String @unique -} -``` - -- `@unique` on a `@col` field adds a single-column unique constraint. -- `@unique` on a `@table` type adds a composite unique constraint. -- `@unique` on a `@ref` defines a one-to-one relation. It adds unique constraint - on `@ref(fields)`. - -`@unique` ensures those fields can uniquely identify a row, so other `@table` -type may define `@ref(references)` to refer to fields that has a unique constraint. - -""" -directive @unique( - """ - Configures the SQL database unique constraint name. - - If not overridden, Data Connect generates the unique constraint name: - - `table_name_first_field_second_field_uidx` - - `table_name_only_field_name_uidx` - """ - indexName: String - """ - Only allowed and required when used on OBJECT, - this specifies the fields to create a unique constraint on. - """ - fields: [String!] -) repeatable on FIELD_DEFINITION | OBJECT - -""" -Date is a string in the YYYY-MM-DD format representing a local-only date. - -See the description for Timestamp for range and limitations. - -As a FDC-specific extension, inputs that includes time portions (as specified by -the Timestamp scalar) are accepted but only the date portion is used. In other -words, only the part before "T" is used and the rest discarded. This effectively -truncates it to the local date in the specified time-zone. - -Outputs will always be in the canonical YYYY-MM-DD format. - -In the PostgreSQL table, it's stored as [`date`](https://www.postgresql.org/docs/current/datatype-datetime.html). -""" -scalar Date @specifiedBy(url: "https://scalars.graphql.org/andimarek/local-date.html") - -""" -Timestamp is a RFC 3339 string that represents an exact point in time. - -The serialization format follows https://scalars.graphql.org/andimarek/date-time -except the "Non-optional exact milliseconds" Section. As a FDC-specific -extension, inputs and outputs may contain 0, 3, 6, or 9 fractional digits. - -Specifically, output precision varies by server-side factors such as data source -support and clients must not rely on an exact number of digits. Clients may -truncate extra digits as fit, with the caveat that there may be information loss -if the truncated value is subsequently sent back to the server. - -FDC only supports year 1583 to 9999 (inclusive) and uses the ISO-8601 calendar -system for all date-time calculations. Notably, the expanded year representation -(+/-YYYYY) is rejected and Year 1582 and before may either be rejected or cause -undefined behavior. - -In the PostgreSQL table, it's stored as [`timestamptz`](https://www.postgresql.org/docs/current/datatype-datetime.html). -""" -scalar Timestamp @specifiedBy(url: "https://scalars.graphql.org/andimarek/date-time") - -""" -A Common Expression Language (CEL) expression that returns a Timestamp at runtime. - -Limitation: Right now, only a few expressions are supported. -""" -scalar Timestamp_Expr - @specifiedBy(url: "https://github.com/google/cel-spec") - @fdc_celExpression(returnType: "google.protobuf.Timestamp") - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType - @fdc_example(value: "request.time", description: "The timestamp when the request is received (with microseconds precision).") - -""" -A Common Expression Language (CEL) expression that returns a Timestamp at runtime, -which is then truncated to UTC date only. The time-of-day parts are discarded. - -Limitation: Right now, only a few expressions are supported. -""" -scalar Date_Expr - @specifiedBy(url: "https://github.com/google/cel-spec") - @fdc_celExpression(returnType: "google.protobuf.Timestamp") - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType - @fdc_example(value: "request.time", description: "The UTC date on which the request is received.") - -"Conditions on a `Date` value." -input Date_Filter { - "Match if the field `IS NULL`." - isNull: Boolean - "Match if the field is exactly equal to the provided value." - eq: Date @fdc_oneOf(group: "eq") - "Match if the field equals the provided CEL expression." - eq_expr: Date_Expr @fdc_oneOf(group: "eq") - "Match if the field equals the provided relative date." - eq_date: Date_Relative @fdc_oneOf(group: "eq") - "Match if the field is not equal to the provided value." - ne: Date @fdc_oneOf(group: "ne") - "Match if the field is not equal to the provided CEL expression." - ne_expr: Date_Expr @fdc_oneOf(group: "ne") - "Match if the field is not equal to the provided relative date." - ne_date: Date_Relative @fdc_oneOf(group: "ne") - "Match if the field value is among the provided list of values." - in: [Date!] - "Match if the field value is not among the provided list of values." - nin: [Date!] - "Match if the field value is greater than the provided value." - gt: Date @fdc_oneOf(group: "gt") - "Match if the field value is greater than the provided CEL expression." - gt_expr: Date_Expr @fdc_oneOf(group: "gt") - "Match if the field value is greater than the provided relative date." - gt_date: Date_Relative @fdc_oneOf(group: "gt") - "Match if the field value is greater than or equal to the provided value." - ge: Date @fdc_oneOf(group: "ge") - "Match if the field value is greater than or equal to the provided CEL expression." - ge_expr: Date_Expr @fdc_oneOf(group: "ge") - "Match if the field value is greater than or equal to the provided relative date." - ge_date: Date_Relative @fdc_oneOf(group: "ge") - "Match if the field value is less than the provided value." - lt: Date @fdc_oneOf(group: "lt") - "Match if the field value is less than the provided CEL expression." - lt_expr: Date_Expr @fdc_oneOf(group: "lt") - "Match if the field value is less than the provided relative date." - lt_date: Date_Relative @fdc_oneOf(group: "lt") - "Match if the field value is less than or equal to the provided value." - le: Date @fdc_oneOf(group: "le") - "Match if the field value is less than or equal to the provided CEL expression." - le_expr: Date_Expr @fdc_oneOf(group: "le") - "Match if the field value is less than or equal to the provided relative date." - le_date: Date_Relative @fdc_oneOf(group: "le") -} - -"Conditions on a`Date` list." -input Date_ListFilter { - "Match if the list contains the provided date." - includes: Date @fdc_oneOf(group: "includes") - "Match if the list contains the provided date CEL expression." - includes_expr: Date_Expr @fdc_oneOf(group: "includes") - "Match if the list contains the provided relative date." - includes_date: Date_Relative @fdc_oneOf(group: "includes") - "Match if the list does not contain the provided date." - excludes: Date @fdc_oneOf(group: "excludes") - "Match if the list does not contain the provided date CEL expression." - excludes_expr: Date_Expr @fdc_oneOf(group: "excludes") - "Match if the list does not contain the provided relative date." - excludes_date: Date_Relative @fdc_oneOf(group: "excludes") - "Match if the list contains all the provided dates." - includesAll: [Date!] - "Match if the list contains none of the provided dates." - excludesAll: [Date!] -} - -"Conditions on a `Timestamp` value." -input Timestamp_Filter { - "Match if the field `IS NULL`." - isNull: Boolean - "Match if the field is exactly equal to the provided value." - eq: Timestamp @fdc_oneOf(group: "eq") - "Match if the field equals the provided CEL expression." - eq_expr: Timestamp_Expr @fdc_oneOf(group: "eq") - "Match if the field equals the provided relative time." - eq_time: Timestamp_Relative @fdc_oneOf(group: "eq") - "Match if the field is not equal to the provided value." - ne: Timestamp @fdc_oneOf(group: "ne") - "Match if the field is not equal to the provided CEL expression." - ne_expr: Timestamp_Expr @fdc_oneOf(group: "ne") - "Match if the field is not equal to the provided relative time." - ne_time: Timestamp_Relative @fdc_oneOf(group: "ne") - "Match if the field value is among the provided list of values." - in: [Timestamp!] - "Match if the field value is not among the provided list of values." - nin: [Timestamp!] - "Match if the field value is greater than the provided value." - gt: Timestamp @fdc_oneOf(group: "gt") - "Match if the field value is greater than the provided CEL expression." - gt_expr: Timestamp_Expr @fdc_oneOf(group: "gt") - "Match if the field value is greater than the provided relative time." - gt_time: Timestamp_Relative @fdc_oneOf(group: "gt") - "Match if the field value is greater than or equal to the provided value." - ge: Timestamp @fdc_oneOf(group: "ge") - "Match if the field value is greater than or equal to the provided CEL expression." - ge_expr: Timestamp_Expr @fdc_oneOf(group: "ge") - "Match if the field value is greater than or equal to the provided relative time." - ge_time: Timestamp_Relative @fdc_oneOf(group: "ge") - "Match if the field value is less than the provided value." - lt: Timestamp @fdc_oneOf(group: "lt") - "Match if the field value is less than the provided CEL expression." - lt_expr: Timestamp_Expr @fdc_oneOf(group: "lt") - "Match if the field value is less than the provided relative time." - lt_time: Timestamp_Relative @fdc_oneOf(group: "lt") - "Match if the field value is less than or equal to the provided value." - le: Timestamp @fdc_oneOf(group: "le") - "Match if the field value is less than or equal to the provided CEL expression." - le_expr: Timestamp_Expr @fdc_oneOf(group: "le") - "Match if the field value is less than or equal to the provided relative time." - le_time: Timestamp_Relative @fdc_oneOf(group: "le") -} - -"Conditions on a `Timestamp` list." -input Timestamp_ListFilter { - "Match if the list contains the provided timestamp." - includes: Timestamp @fdc_oneOf(group: "includes") - "Match if the list contains the provided timestamp CEL expression." - includes_expr: Timestamp_Expr @fdc_oneOf(group: "includes") - "Match if the list contains the provided relative timestamp." - includes_time: Timestamp_Relative @fdc_oneOf(group: "includes") - "Match if the list does not contain the provided timestamp." - excludes: Timestamp @fdc_oneOf(group: "excludes") - "Match if the list does not contain the provided timestamp CEL expression." - excludes_expr: Timestamp_Expr @fdc_oneOf(group: "excludes") - "Match if the list does not contain the provided relative timestamp." - excludes_time: Timestamp_Relative @fdc_oneOf(group: "excludes") - "Match if the list contains all the provided timestamps." - includesAll: [Timestamp!] - "Match if the list contains none of the provided timestamps." - excludesAll: [Timestamp!] -} - -"Update input of a `Date` value." -input Date_Update { - "Set the field to the provided date." - set: Date @fdc_oneOf(group: "set") - "Set the field to the provided date CEL expression." - set_expr: Date_Expr @fdc_oneOf(group: "set") - "Set the field to the provided relative date." - set_date: Date_Relative @fdc_oneOf(group: "set") -} - -"Update input of a `Date` list value." -input Date_ListUpdate { - "Replace the current list with the provided list of `Date` values." - set: [Date!] - "Append the provided `Date` values to the existing list." - append: [Date!] - "Prepend the provided `Date` values to the existing list." - prepend: [Date!] - "Remove the date value at the specified index." - delete: Int - "The index of the list to perform updates." - i: Int - "Update the date value at the specified index." - update: Date -} - -"Update input of a `Timestamp` value." -input Timestamp_Update { - "Set the field to the provided timestamp." - set: Timestamp @fdc_oneOf(group: "set") - "Set the field to the provided timestamp CEL expression." - set_expr: Timestamp_Expr @fdc_oneOf(group: "set") - "Set the field to the provided relative timestamp." - set_time: Timestamp_Relative @fdc_oneOf(group: "set") -} - -"Update input of an `Timestamp` list value." -input Timestamp_ListUpdate { - "Replace the current list with the provided list of `Timestamp` values." - set: [Timestamp!] - "Append the provided `Timestamp` values to the existing list." - append: [Timestamp!] - "Prepend the provided `Timestamp` values to the existing list." - prepend: [Timestamp!] - "Remove the timestamp value at the specified index." - delete: Int - "The index of the list to perform updates." - i: Int - "Update the timestamp value at the specified index." - update: Timestamp -} - - -"A runtime-calculated `Timestamp` value relative to `now` or `at`." -input Timestamp_Relative @fdc_forbiddenAsVariableType @fdc_forbiddenAsFieldType { - "Match for the current time." - now: True @fdc_oneOf(group: "from", required: true) - "A specific timestamp for matching." - at: Timestamp @fdc_oneOf(group: "from", required: true) - "Add the provided duration to the base timestamp." - add: Timestamp_Duration - "Subtract the provided duration from the base timestamp." - sub: Timestamp_Duration - "Truncate the timestamp to the provided interval." - truncateTo: Timestamp_Interval -} - -input Timestamp_Duration @fdc_forbiddenAsVariableType @fdc_forbiddenAsFieldType { - "The number of milliseconds for the duration." - milliseconds: Int! = 0 - "The number of seconds for the duration." - seconds: Int! = 0 - "The number of minutes for the duration." - minutes: Int! = 0 - "The number of hours for the duration." - hours: Int! = 0 - "The number of days for the duration." - days: Int! = 0 - "The number of weeks for the duration." - weeks: Int! = 0 - "The number of months for the duration." - months: Int! = 0 - "The number of years for the duration." - years: Int! = 0 -} - -enum Timestamp_Interval @fdc_forbiddenAsFieldType { - "Represents a time interval of one second." - SECOND - "Represents a time interval of one minute." - MINUTE - "Represents a time interval of one hour." - HOUR - "Represents a time interval of one day." - DAY - "Represents a time interval of one week." - WEEK - "Represents a time interval of one month." - MONTH - "Represents a time interval of one year." - YEAR -} - -"A runtime-calculated Date value relative to `today` or `on`." -input Date_Relative @fdc_forbiddenAsVariableType @fdc_forbiddenAsFieldType { - "Match for today’s date." - today: True @fdc_oneOf(group: "from", required: true) - "A specific date for matching." - on: Date @fdc_oneOf(group: "from", required: true) - "Add the provided duration to the base date." - add: Date_Duration - "Subtract the provided duration from the base date." - sub: Date_Duration - "Truncate the date to the provided interval." - truncateTo: Date_Interval -} - -input Date_Duration @fdc_forbiddenAsVariableType @fdc_forbiddenAsFieldType { - "The number of days for the duration." - days: Int! = 0 - "The number of weeks for the duration." - weeks: Int! = 0 - "The number of months for the duration." - months: Int! = 0 - "The number of years for the duration." - years: Int! = 0 -} - -enum Date_Interval @fdc_forbiddenAsFieldType { - "Represents a time interval of one week." - WEEK - "Represents a time interval of one month." - MONTH - "Represents a time interval of one year." - YEAR -} - -"Update input of a `String` value." -input String_Update { - "Set the field to a provided value." - set: String @fdc_oneOf(group: "set") - "Set the field to a provided server value expression." - set_expr: String_Expr @fdc_oneOf(group: "set") -} - -"Update input of a `String` list value." -input String_ListUpdate { - "Set the list with the provided values." - set: [String!] - "Append the provided values to the existing list." - append: [String!] - "Prepend the provided values to the existing list." - prepend: [String!] -} - -"Update input of a `UUID` value." -input UUID_Update { - "Set the field to a provided UUID." - set: UUID @fdc_oneOf(group: "set") - "Set the field to a provided UUID expression." - set_expr: UUID_Expr @fdc_oneOf(group: "set") -} - -"Update input of an `ID` list value." -input UUID_ListUpdate { - "Set the list with the provided list of UUIDs." - set: [UUID!] - "Append the provided UUIDs to the existing list." - append: [UUID!] - "Prepend the provided UUIDs to the existing list." - prepend: [UUID!] -} - -"Update input of an `Int` value." -input Int_Update { - "Set the field to a provided value." - set: Int - "Increment the field by a provided value." - inc: Int - "Decrement the field by a provided value." - dec: Int -} - -"Update input of an `Int` list value." -input Int_ListUpdate { - "Set the list with the provided values." - set: [Int!] - "Append the provided list of values to the existing list." - append: [Int!] - "Prepend the provided list of values to the existing list." - prepend: [Int!] -} - -"Update input of an `Int64` value." -input Int64_Update { - "Set the field to a provided value." - set: Int64 - "Increment the field by a provided value." - inc: Int64 - "Decrement the field by a provided value." - dec: Int64 -} - -"Update input of an `Int64` list value." -input Int64_ListUpdate { - "Replace the list with the provided values." - set: [Int64!] - "Append the provided list of values to the existing list." - append: [Int64!] - "Prepend the provided list of values to the existing list." - prepend: [Int64!] -} - -"Update input of a `Float` value." -input Float_Update { - "Set the field to a provided value." - set: Float - "Increment the field by a provided value." - inc: Float - "Decrement the field by a provided value." - dec: Float -} - -"Update input of a `Float` list value." -input Float_ListUpdate { - "Set the list with the provided values." - set: [Float!] - "Append the provided list of values to the existing list." - append: [Float!] - "Prepend the provided list of values to the existing list." - prepend: [Float!] -} - -"Update input of a `Boolean` value." -input Boolean_Update { - "Set the field to a provided value." - set: Boolean -} - -"Update input of a `Boolean` list value." -input Boolean_ListUpdate { - "Set the list with the provided values." - set: [Boolean!] - "Append the provided list of values to the existing list." - append: [Boolean!] - "Prepend the provided list of values to the existing list." - prepend: [Boolean!] -} - -"Update input of an `Any` value." -input Any_Update { - "Set the field to a provided value." - set: Any -} - -"Update input of an `Any` list value." -input Any_ListUpdate { - "Set the list with the provided values." - set: [Any!] - "Append the provided list of values to the existing list." - append: [Any!] - "Prepend the provided list of values to the existing list." - prepend: [Any!] -} - -type Query { - """ - _service provides customized introspection on Firebase Data Connect Sevice. - """ - _service: _Service! -} - -""" -Vector is an array of single-precision floating-point numbers, serialized -as a JSON array. All elements must be finite (no NaN, Infinity or -Infinity). - -Example: [1.1, 2, 3.3] - -In the PostgreSQL table, it's stored as [`pgvector`](https://github.com/pgvector/pgvector). - -See `Vector_Embed` for how to generate text embeddings in query and mutations. -""" -scalar Vector - -""" -Defines the similarity function to use when comparing vectors in queries. - -Defaults to `INNER_PRODUCT`. - -View [all vector functions](https://github.com/pgvector/pgvector?tab=readme-ov-file#vector-functions). -""" -enum VectorSimilarityMethod { - "Measures the Euclidean (L2) distance between two vectors." - L2 - "Measures the cosine similarity between two vectors." - COSINE - "Measures the inner product(dot product) between two vectors." - INNER_PRODUCT -} - -"Conditions on a Vector value." -input Vector_Filter { - "Match if the field is exactly equal to the provided vector." - eq: Vector - "Match if the field is not equal to the provided vector." - ne: Vector - "Match if the field value is among the provided list of vectors." - in: [Vector!] - "Match if the field value is not among the provided list of vectors." - nin: [Vector!] - "Match if the field is `NULL`." - isNull: Boolean -} - -input Vector_ListFilter { - "Match if the list includes the supplied vector." - includes: Vector - "Match if the list does not include the supplied vector." - excludes: Vector - "Match if the list contains all the provided vectors." - includesAll: [Vector!] - "Match if the list contains none of the provided vectors." - excludesAll: [Vector!] -} - -"Update input of a Vector value." -input Vector_Update { - "Set the field to the provided vector value." - set: Vector @fdc_oneOf(group: "set") - "Set the field to the vector embedding result from a text input." - set_embed: Vector_Embed @fdc_oneOf(group: "set") -} - - -"Update input of a Vector list value." -input Vector_ListUpdate { - "Replace the current list with the provided list of Vector values." - set: [Vector] - "Append the provided Vector values to the existing list." - append: [Vector] - "Prepend the provided Vector values to the existing list." - prepend: [Vector] - "Delete the vector at the specified index." - delete: Int - "The index of the vector to be updated." - i: Int - "Update the vector at the specified index." - update: Vector -} - -""" -Create a vector embedding of text using the given model on Vertex AI. - -Cloud SQL for Postgresql natively integrates with [Vertex AI Text embeddings API](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api) -to effectively generate text embeddings. - -If you uses [`Vector`](scalar.md#Vector) in your schema, Firebase Data Connect automatically installs -[`pgvector`](https://github.com/pgvector/pgvector) and [`google_ml_integration`](https://cloud.google.com/sql/docs/postgres/integrate-cloud-sql-with-vertex-ai) -Postgres extensions in your Cloud SQL database. - -Given a Post table with a `Vector` embedding field. - -```graphql -type Post @table { - content: String! - contentEmbedding: Vector @col(size:768) -} -``` - -NOTE: All natively supported `Vector_Embed_Model` generates vector of length `768`. - -###### Example: Insert embedding - -```graphql -mutation CreatePost($content: String!) { - post_insert(data: { - content: $content, - contentEmbedding_embed: {model: "textembedding-gecko@003", text: $content}, - }) -} -``` - -###### Example: Vector similarity Search - -```graphql -query SearchPost($query: String!) { - posts_contentEmbedding_similarity(compare_embed: {model: "textembedding-gecko@003", text: $query}) { - id - content - } -} -``` -""" -input Vector_Embed @fdc_forbiddenAsVariableType { - """ - The model to use for vector embedding. - Recommend the latest stable model: `textembedding-gecko@003`. - """ - model: Vector_Embed_Model! - "The text to generate the vector embedding from." - text: String! -} - -""" -The Vertex AI model version that is required in input `Vector_Embed`. - -It is recommended to use the latest stable model version: `textembedding-gecko@003`. - -View all supported [Vertex AI Text embeddings APIs](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api). -""" -scalar Vector_Embed_Model - @specifiedBy(url: "https://cloud.google.com/vertex-ai/generative-ai/docs/learn/model-versioning") - @fdc_forbiddenAsVariableType - @fdc_forbiddenAsFieldType - @fdc_example(value: "textembedding-gecko@003", description: "A stable version of the textembedding-gecko model") - @fdc_example(value: "textembedding-gecko@001", description: "An older version of the textembedding-gecko model") - @fdc_example(value: "text-embedding-004", description: "Another text embedding model") - -""" -The `_Metadata` type is used to return metadata about a field in a response. -""" -type _Metadata { - # During vector similarity search, the distance between the query vector and - # this row's vector. In other cases, this field is not set. - distance: Float -} - diff --git a/starters/nextjs/firebase-ecommerce/firebase.json b/starters/nextjs/firebase-ecommerce/firebase.json index 73f59971..60c3ee03 100644 --- a/starters/nextjs/firebase-ecommerce/firebase.json +++ b/starters/nextjs/firebase-ecommerce/firebase.json @@ -1,5 +1,22 @@ { "dataconnect": { "source": "dataconnect" + }, + "emulators": { + "apphosting": { + "port": 5002, + "rootDirectory": "./" + }, + "auth": { + "port": 9099 + }, + "dataconnect": { + "port": 9399, + "dataDir": "dataconnect/.dataconnect/pgliteData" + }, + "ui": { + "enabled": true + }, + "singleProjectMode": true } }