From 5b1b9973398ac898bb362e11a6fcdd6775829695 Mon Sep 17 00:00:00 2001 From: Massimiliano Angelino Date: Tue, 23 Jan 2024 16:40:49 +0100 Subject: [PATCH] fix(api): autogen graphql client API files --- lib/user-interface/react-app/schema.json | 295 +++++++++--------- lib/user-interface/react-app/src/API.ts | 72 ++--- .../react-app/src/graphql/mutations.ts | 38 +-- .../react-app/src/graphql/queries.ts | 4 - 4 files changed, 194 insertions(+), 215 deletions(-) diff --git a/lib/user-interface/react-app/schema.json b/lib/user-interface/react-app/schema.json index 31400f6dd..76e29abd8 100644 --- a/lib/user-interface/react-app/schema.json +++ b/lib/user-interface/react-app/schema.json @@ -15,17 +15,6 @@ "name" : "Query", "description" : null, "fields" : [ { - "name" : "none", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { "name" : "checkHealth", "description" : null, "args" : [ ], @@ -466,15 +455,6 @@ "interfaces" : [ ], "enumValues" : null, "possibleTypes" : null - }, { - "kind" : "SCALAR", - "name" : "String", - "description" : "Built-in String", - "fields" : null, - "inputFields" : null, - "interfaces" : null, - "enumValues" : null, - "possibleTypes" : null }, { "kind" : "SCALAR", "name" : "Boolean", @@ -519,6 +499,15 @@ "interfaces" : [ ], "enumValues" : null, "possibleTypes" : null + }, { + "kind" : "SCALAR", + "name" : "String", + "description" : "Built-in String", + "fields" : null, + "inputFields" : null, + "interfaces" : null, + "enumValues" : null, + "possibleTypes" : null }, { "kind" : "INPUT_OBJECT", "name" : "FileUploadInput", @@ -963,7 +952,7 @@ "args" : [ ], "type" : { "kind" : "SCALAR", - "name" : "String", + "name" : "Boolean", "ofType" : null }, "isDeprecated" : false, @@ -2414,64 +2403,6 @@ "name" : "Mutation", "description" : null, "fields" : [ { - "name" : "sendQuery", - "description" : null, - "args" : [ { - "name" : "data", - "description" : null, - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "defaultValue" : null - } ], - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { - "name" : "publishResponse", - "description" : null, - "args" : [ { - "name" : "sessionId", - "description" : null, - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "defaultValue" : null - }, { - "name" : "userId", - "description" : null, - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "defaultValue" : null - }, { - "name" : "data", - "description" : null, - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "defaultValue" : null - } ], - "type" : { - "kind" : "OBJECT", - "name" : "Channel", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null - }, { "name" : "createKendraWorkspace", "description" : null, "args" : [ { @@ -2790,30 +2721,19 @@ }, "isDeprecated" : false, "deprecationReason" : null - } ], - "inputFields" : null, - "interfaces" : [ ], - "enumValues" : null, - "possibleTypes" : null - }, { - "kind" : "OBJECT", - "name" : "Channel", - "description" : null, - "fields" : [ { - "name" : "data", - "description" : null, - "args" : [ ], - "type" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - }, - "isDeprecated" : false, - "deprecationReason" : null }, { - "name" : "sessionId", - "description" : null, - "args" : [ ], + "name" : "sendQuery", + "description" : " Real-time", + "args" : [ { + "name" : "data", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + } ], "type" : { "kind" : "SCALAR", "name" : "String", @@ -2822,12 +2742,39 @@ "isDeprecated" : false, "deprecationReason" : null }, { - "name" : "userId", + "name" : "publishResponse", "description" : null, - "args" : [ ], + "args" : [ { + "name" : "sessionId", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "userId", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + }, { + "name" : "data", + "description" : null, + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "defaultValue" : null + } ], "type" : { - "kind" : "SCALAR", - "name" : "String", + "kind" : "OBJECT", + "name" : "Channel", "ofType" : null }, "isDeprecated" : false, @@ -3061,7 +3008,7 @@ }, { "kind" : "INPUT_OBJECT", "name" : "CreateWorkspaceAuroraInput", - "description" : null, + "description" : " Workspaces", "fields" : null, "inputFields" : [ { "name" : "name", @@ -3617,6 +3564,48 @@ "interfaces" : [ ], "enumValues" : null, "possibleTypes" : null + }, { + "kind" : "OBJECT", + "name" : "Channel", + "description" : null, + "fields" : [ { + "name" : "data", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "sessionId", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + }, { + "name" : "userId", + "description" : null, + "args" : [ ], + "type" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + }, + "isDeprecated" : false, + "deprecationReason" : null + } ], + "inputFields" : null, + "interfaces" : [ ], + "enumValues" : null, + "possibleTypes" : null }, { "kind" : "OBJECT", "name" : "Subscription", @@ -4429,6 +4418,35 @@ "onOperation" : false, "onFragment" : false, "onField" : true + }, { + "name" : "aws_iam", + "description" : "Tells the service this field/object has access authorized by sigv4 signing.", + "locations" : [ "OBJECT", "FIELD_DEFINITION" ], + "args" : [ ], + "onOperation" : false, + "onFragment" : false, + "onField" : false + }, { + "name" : "aws_publish", + "description" : "Tells the service which subscriptions will be published to when this mutation is called. This directive is deprecated use @aws_susbscribe directive instead.", + "locations" : [ "FIELD_DEFINITION" ], + "args" : [ { + "name" : "subscriptions", + "description" : "List of subscriptions which will be published to when this mutation is called.", + "type" : { + "kind" : "LIST", + "name" : null, + "ofType" : { + "kind" : "SCALAR", + "name" : "String", + "ofType" : null + } + }, + "defaultValue" : null + } ], + "onOperation" : false, + "onFragment" : false, + "onField" : false }, { "name" : "aws_oidc", "description" : "Tells the service this field/object has access authorized by an OIDC token.", @@ -4455,20 +4473,12 @@ "onFragment" : false, "onField" : false }, { - "name" : "aws_lambda", - "description" : "Tells the service this field/object has access authorized by a Lambda Authorizer.", + "name" : "aws_cognito_user_pools", + "description" : "Tells the service this field/object has access authorized by a Cognito User Pools token.", "locations" : [ "OBJECT", "FIELD_DEFINITION" ], - "args" : [ ], - "onOperation" : false, - "onFragment" : false, - "onField" : false - }, { - "name" : "aws_subscribe", - "description" : "Tells the service which mutation triggers this subscription.", - "locations" : [ "FIELD_DEFINITION" ], "args" : [ { - "name" : "mutations", - "description" : "List of mutations which will trigger this subscription when they are called.", + "name" : "cognito_groups", + "description" : "List of cognito user pool groups which have access on this field", "type" : { "kind" : "LIST", "name" : null, @@ -4484,9 +4494,9 @@ "onFragment" : false, "onField" : false }, { - "name" : "aws_cognito_user_pools", - "description" : "Tells the service this field/object has access authorized by a Cognito User Pools token.", - "locations" : [ "OBJECT", "FIELD_DEFINITION" ], + "name" : "aws_auth", + "description" : "Directs the schema to enforce authorization on a field", + "locations" : [ "FIELD_DEFINITION" ], "args" : [ { "name" : "cognito_groups", "description" : "List of cognito user pool groups which have access on this field", @@ -4505,41 +4515,28 @@ "onFragment" : false, "onField" : false }, { - "name" : "aws_iam", - "description" : "Tells the service this field/object has access authorized by sigv4 signing.", + "name" : "aws_api_key", + "description" : "Tells the service this field/object has access authorized by an API key.", "locations" : [ "OBJECT", "FIELD_DEFINITION" ], "args" : [ ], "onOperation" : false, "onFragment" : false, "onField" : false }, { - "name" : "aws_publish", - "description" : "Tells the service which subscriptions will be published to when this mutation is called. This directive is deprecated use @aws_susbscribe directive instead.", - "locations" : [ "FIELD_DEFINITION" ], - "args" : [ { - "name" : "subscriptions", - "description" : "List of subscriptions which will be published to when this mutation is called.", - "type" : { - "kind" : "LIST", - "name" : null, - "ofType" : { - "kind" : "SCALAR", - "name" : "String", - "ofType" : null - } - }, - "defaultValue" : null - } ], + "name" : "aws_lambda", + "description" : "Tells the service this field/object has access authorized by a Lambda Authorizer.", + "locations" : [ "OBJECT", "FIELD_DEFINITION" ], + "args" : [ ], "onOperation" : false, "onFragment" : false, "onField" : false }, { - "name" : "aws_auth", - "description" : "Directs the schema to enforce authorization on a field", + "name" : "aws_subscribe", + "description" : "Tells the service which mutation triggers this subscription.", "locations" : [ "FIELD_DEFINITION" ], "args" : [ { - "name" : "cognito_groups", - "description" : "List of cognito user pool groups which have access on this field", + "name" : "mutations", + "description" : "List of mutations which will trigger this subscription when they are called.", "type" : { "kind" : "LIST", "name" : null, @@ -4554,14 +4551,6 @@ "onOperation" : false, "onFragment" : false, "onField" : false - }, { - "name" : "aws_api_key", - "description" : "Tells the service this field/object has access authorized by an API key.", - "locations" : [ "OBJECT", "FIELD_DEFINITION" ], - "args" : [ ], - "onOperation" : false, - "onFragment" : false, - "onField" : false } ] } } diff --git a/lib/user-interface/react-app/src/API.ts b/lib/user-interface/react-app/src/API.ts index 75dd2c56d..c19dd1516 100644 --- a/lib/user-interface/react-app/src/API.ts +++ b/lib/user-interface/react-app/src/API.ts @@ -2,13 +2,6 @@ /* eslint-disable */ // This file was automatically generated and should not be edited. -export type Channel = { - __typename: "Channel", - data?: string | null, - sessionId?: string | null, - userId?: string | null, -}; - export type CreateWorkspaceKendraInput = { name: string, kind: string, @@ -41,7 +34,7 @@ export type Workspace = { documents?: number | null, sizeInBytes?: number | null, kendraIndexId?: string | null, - kendraIndexExternal?: string | null, + kendraIndexExternal?: boolean | null, kendraUseAllData?: boolean | null, createdAt: string, updatedAt: string, @@ -124,6 +117,13 @@ export type DeleteSessionResult = { deleted: boolean, }; +export type Channel = { + __typename: "Channel", + data?: string | null, + sessionId?: string | null, + userId?: string | null, +}; + export type FileUploadInput = { workspaceId: string, fileName: string, @@ -307,29 +307,6 @@ export type PassageRank = { passage: string, }; -export type SendQueryMutationVariables = { - data?: string | null, -}; - -export type SendQueryMutation = { - sendQuery?: string | null, -}; - -export type PublishResponseMutationVariables = { - sessionId?: string | null, - userId?: string | null, - data?: string | null, -}; - -export type PublishResponseMutation = { - publishResponse?: { - __typename: "Channel", - data?: string | null, - sessionId?: string | null, - userId?: string | null, - } | null, -}; - export type CreateKendraWorkspaceMutationVariables = { input: CreateWorkspaceKendraInput, }; @@ -360,7 +337,7 @@ export type CreateKendraWorkspaceMutation = { documents?: number | null, sizeInBytes?: number | null, kendraIndexId?: string | null, - kendraIndexExternal?: string | null, + kendraIndexExternal?: boolean | null, kendraUseAllData?: boolean | null, createdAt: string, updatedAt: string, @@ -397,7 +374,7 @@ export type CreateOpenSearchWorkspaceMutation = { documents?: number | null, sizeInBytes?: number | null, kendraIndexId?: string | null, - kendraIndexExternal?: string | null, + kendraIndexExternal?: boolean | null, kendraUseAllData?: boolean | null, createdAt: string, updatedAt: string, @@ -434,7 +411,7 @@ export type CreateAuroraWorkspaceMutation = { documents?: number | null, sizeInBytes?: number | null, kendraIndexId?: string | null, - kendraIndexExternal?: string | null, + kendraIndexExternal?: boolean | null, kendraUseAllData?: boolean | null, createdAt: string, updatedAt: string, @@ -558,11 +535,28 @@ export type DeleteSessionMutation = { } | null, }; -export type NoneQueryVariables = { +export type SendQueryMutationVariables = { + data?: string | null, +}; + +export type SendQueryMutation = { + // Real-time + sendQuery?: string | null, +}; + +export type PublishResponseMutationVariables = { + sessionId?: string | null, + userId?: string | null, + data?: string | null, }; -export type NoneQuery = { - none?: string | null, +export type PublishResponseMutation = { + publishResponse?: { + __typename: "Channel", + data?: string | null, + sessionId?: string | null, + userId?: string | null, + } | null, }; export type CheckHealthQueryVariables = { @@ -629,7 +623,7 @@ export type ListWorkspacesQuery = { documents?: number | null, sizeInBytes?: number | null, kendraIndexId?: string | null, - kendraIndexExternal?: string | null, + kendraIndexExternal?: boolean | null, kendraUseAllData?: boolean | null, createdAt: string, updatedAt: string, @@ -666,7 +660,7 @@ export type GetWorkspaceQuery = { documents?: number | null, sizeInBytes?: number | null, kendraIndexId?: string | null, - kendraIndexExternal?: string | null, + kendraIndexExternal?: boolean | null, kendraUseAllData?: boolean | null, createdAt: string, updatedAt: string, diff --git a/lib/user-interface/react-app/src/graphql/mutations.ts b/lib/user-interface/react-app/src/graphql/mutations.ts index fe5f6148d..5d93e490d 100644 --- a/lib/user-interface/react-app/src/graphql/mutations.ts +++ b/lib/user-interface/react-app/src/graphql/mutations.ts @@ -8,25 +8,6 @@ type GeneratedMutation = string & { __generatedMutationOutput: OutputType; }; -export const sendQuery = /* GraphQL */ `mutation SendQuery($data: String) { - sendQuery(data: $data) -} -` as GeneratedMutation< - APITypes.SendQueryMutationVariables, - APITypes.SendQueryMutation ->; -export const publishResponse = /* GraphQL */ `mutation PublishResponse($sessionId: String, $userId: String, $data: String) { - publishResponse(sessionId: $sessionId, userId: $userId, data: $data) { - data - sessionId - userId - __typename - } -} -` as GeneratedMutation< - APITypes.PublishResponseMutationVariables, - APITypes.PublishResponseMutation ->; export const createKendraWorkspace = /* GraphQL */ `mutation CreateKendraWorkspace($input: CreateWorkspaceKendraInput!) { createKendraWorkspace(input: $input) { id @@ -245,3 +226,22 @@ export const deleteSession = /* GraphQL */ `mutation DeleteSession($id: String!) APITypes.DeleteSessionMutationVariables, APITypes.DeleteSessionMutation >; +export const sendQuery = /* GraphQL */ `mutation SendQuery($data: String) { + sendQuery(data: $data) +} +` as GeneratedMutation< + APITypes.SendQueryMutationVariables, + APITypes.SendQueryMutation +>; +export const publishResponse = /* GraphQL */ `mutation PublishResponse($sessionId: String, $userId: String, $data: String) { + publishResponse(sessionId: $sessionId, userId: $userId, data: $data) { + data + sessionId + userId + __typename + } +} +` as GeneratedMutation< + APITypes.PublishResponseMutationVariables, + APITypes.PublishResponseMutation +>; diff --git a/lib/user-interface/react-app/src/graphql/queries.ts b/lib/user-interface/react-app/src/graphql/queries.ts index fcdaf9ee0..0eff5181e 100644 --- a/lib/user-interface/react-app/src/graphql/queries.ts +++ b/lib/user-interface/react-app/src/graphql/queries.ts @@ -8,10 +8,6 @@ type GeneratedQuery = string & { __generatedQueryOutput: OutputType; }; -export const none = /* GraphQL */ `query None { - none -} -` as GeneratedQuery; export const checkHealth = /* GraphQL */ `query CheckHealth { checkHealth }