diff --git a/.prettierignore b/.prettierignore index 426da550..f06235c4 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,2 @@ -src/gql +node_modules +dist diff --git a/codegen.yml b/codegen.yml index 699888aa..6ec17cfe 100644 --- a/codegen.yml +++ b/codegen.yml @@ -8,3 +8,7 @@ generates: preset: gql-tag-operations-preset presetConfig: fragmentMasking: true + +hooks: + afterOneFileWrite: + - prettier --write diff --git a/src/CharacterEditor.tsx b/src/CharacterEditor.tsx index c0c7f282..50026895 100644 --- a/src/CharacterEditor.tsx +++ b/src/CharacterEditor.tsx @@ -35,22 +35,6 @@ import { useResetState } from "./useResetState"; import { OBSInstructions } from "./OBSInstructions"; import { CreateCharacterMutation } from "./LandingPage"; -const CharacterViewFragment = gql(/* GraphQL */ ` - fragment CharacterViewFragment on Character { - id - name - imageUrl - maximumHealth - currentHealth - hasMana - maximumMana - currentMana - hasFatePoints - maximumFatePoints - currentFatePoints - } -`); - const CharacterEditorQuery = gql(/* GraphQL */ ` query CharacterEditorQuery($editHash: ID!) @live { characterEditor(editHash: $editHash) { @@ -146,6 +130,22 @@ const UpdateCharacterMutation = gql(/* GraphQL */ ` } `); +const CharacterViewFragment = gql(/* GraphQL */ ` + fragment CharacterViewFragment on Character { + id + name + imageUrl + maximumHealth + currentHealth + hasMana + maximumMana + currentMana + hasFatePoints + maximumFatePoints + currentFatePoints + } +`); + const Editor = (props: { character: FragmentType; editHash: string; diff --git a/src/gql/gql.ts b/src/gql/gql.ts index 6b7e5203..42ec17cb 100644 --- a/src/gql/gql.ts +++ b/src/gql/gql.ts @@ -4,17 +4,17 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ const documents = { "\n query CharacterQuery($characterId: ID!) @live {\n character(id: $characterId) {\n id\n ...CharacterViewFragment\n ...CharacterOverlayFragment\n }\n }\n": graphql.CharacterQueryDocument, - "\n fragment CharacterViewFragment on Character {\n id\n name\n imageUrl\n maximumHealth\n currentHealth\n hasMana\n maximumMana\n currentMana\n hasFatePoints\n maximumFatePoints\n currentFatePoints\n }\n": graphql.CharacterViewFragmentFragmentDoc, "\n query CharacterEditorQuery($editHash: ID!) @live {\n characterEditor(editHash: $editHash) {\n __typename\n ... on Error {\n reason\n }\n ... on CharacterEditorView {\n character {\n id\n ...CharacterViewFragment\n }\n }\n }\n }\n": graphql.CharacterEditorQueryDocument, "\n mutation UpdateCharacterMutation($input: UpdateCharacterInput!) {\n updateCharacter(input: $input)\n }\n": graphql.UpdateCharacterMutationDocument, + "\n fragment CharacterViewFragment on Character {\n id\n name\n imageUrl\n maximumHealth\n currentHealth\n hasMana\n maximumMana\n currentMana\n hasFatePoints\n maximumFatePoints\n currentFatePoints\n }\n": graphql.CharacterViewFragmentFragmentDoc, "\n fragment CharacterOverlayFragment on Character {\n id\n name\n currentHealth\n maximumHealth\n hasMana\n currentMana\n maximumMana\n hasFatePoints\n currentFatePoints\n maximumFatePoints\n imageUrl\n }\n": graphql.CharacterOverlayFragmentFragmentDoc, "\n mutation CreateCharacterMutation {\n createCharacter {\n __typename\n ... on Error {\n reason\n }\n ... on CreateCharacterSuccess {\n editHash\n }\n }\n }\n": graphql.CreateCharacterMutationDocument, }; export function gql(source: "\n query CharacterQuery($characterId: ID!) @live {\n character(id: $characterId) {\n id\n ...CharacterViewFragment\n ...CharacterOverlayFragment\n }\n }\n"): (typeof documents)["\n query CharacterQuery($characterId: ID!) @live {\n character(id: $characterId) {\n id\n ...CharacterViewFragment\n ...CharacterOverlayFragment\n }\n }\n"]; -export function gql(source: "\n fragment CharacterViewFragment on Character {\n id\n name\n imageUrl\n maximumHealth\n currentHealth\n hasMana\n maximumMana\n currentMana\n hasFatePoints\n maximumFatePoints\n currentFatePoints\n }\n"): (typeof documents)["\n fragment CharacterViewFragment on Character {\n id\n name\n imageUrl\n maximumHealth\n currentHealth\n hasMana\n maximumMana\n currentMana\n hasFatePoints\n maximumFatePoints\n currentFatePoints\n }\n"]; export function gql(source: "\n query CharacterEditorQuery($editHash: ID!) @live {\n characterEditor(editHash: $editHash) {\n __typename\n ... on Error {\n reason\n }\n ... on CharacterEditorView {\n character {\n id\n ...CharacterViewFragment\n }\n }\n }\n }\n"): (typeof documents)["\n query CharacterEditorQuery($editHash: ID!) @live {\n characterEditor(editHash: $editHash) {\n __typename\n ... on Error {\n reason\n }\n ... on CharacterEditorView {\n character {\n id\n ...CharacterViewFragment\n }\n }\n }\n }\n"]; export function gql(source: "\n mutation UpdateCharacterMutation($input: UpdateCharacterInput!) {\n updateCharacter(input: $input)\n }\n"): (typeof documents)["\n mutation UpdateCharacterMutation($input: UpdateCharacterInput!) {\n updateCharacter(input: $input)\n }\n"]; +export function gql(source: "\n fragment CharacterViewFragment on Character {\n id\n name\n imageUrl\n maximumHealth\n currentHealth\n hasMana\n maximumMana\n currentMana\n hasFatePoints\n maximumFatePoints\n currentFatePoints\n }\n"): (typeof documents)["\n fragment CharacterViewFragment on Character {\n id\n name\n imageUrl\n maximumHealth\n currentHealth\n hasMana\n maximumMana\n currentMana\n hasFatePoints\n maximumFatePoints\n currentFatePoints\n }\n"]; export function gql(source: "\n fragment CharacterOverlayFragment on Character {\n id\n name\n currentHealth\n maximumHealth\n hasMana\n currentMana\n maximumMana\n hasFatePoints\n currentFatePoints\n maximumFatePoints\n imageUrl\n }\n"): (typeof documents)["\n fragment CharacterOverlayFragment on Character {\n id\n name\n currentHealth\n maximumHealth\n hasMana\n currentMana\n maximumMana\n hasFatePoints\n currentFatePoints\n maximumFatePoints\n imageUrl\n }\n"]; export function gql(source: "\n mutation CreateCharacterMutation {\n createCharacter {\n __typename\n ... on Error {\n reason\n }\n ... on CreateCharacterSuccess {\n editHash\n }\n }\n }\n"): (typeof documents)["\n mutation CreateCharacterMutation {\n createCharacter {\n __typename\n ... on Error {\n reason\n }\n ... on CreateCharacterSuccess {\n editHash\n }\n }\n }\n"]; diff --git a/src/gql/graphql.ts b/src/gql/graphql.ts index 12d34f73..3c8f301a 100644 --- a/src/gql/graphql.ts +++ b/src/gql/graphql.ts @@ -1,10 +1,16 @@ /* eslint-disable */ -import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; +import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core"; export type Maybe = T | null; export type InputMaybe = Maybe; -export type Exact = { [K in keyof T]: T[K] }; -export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; -export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string; @@ -15,123 +21,495 @@ export type Scalars = { }; export type Character = { - __typename?: 'Character'; - currentFatePoints: Scalars['Int']; - currentHealth: Scalars['Int']; - currentMana: Scalars['Int']; - hasFatePoints: Scalars['Boolean']; - hasMana: Scalars['Boolean']; - id: Scalars['ID']; - imageUrl?: Maybe; - maximumFatePoints: Scalars['Int']; - maximumHealth: Scalars['Int']; - maximumMana: Scalars['Int']; - name: Scalars['String']; + __typename?: "Character"; + currentFatePoints: Scalars["Int"]; + currentHealth: Scalars["Int"]; + currentMana: Scalars["Int"]; + hasFatePoints: Scalars["Boolean"]; + hasMana: Scalars["Boolean"]; + id: Scalars["ID"]; + imageUrl?: Maybe; + maximumFatePoints: Scalars["Int"]; + maximumHealth: Scalars["Int"]; + maximumMana: Scalars["Int"]; + name: Scalars["String"]; }; export type CharacterEditor = CharacterEditorView | Error; export type CharacterEditorView = { - __typename?: 'CharacterEditorView'; + __typename?: "CharacterEditorView"; character: Character; }; export type CharacterUpdateFields = { - currentFatePoints?: InputMaybe; - currentHealth?: InputMaybe; - currentMana?: InputMaybe; - hasFatePoints?: InputMaybe; - hasMana?: InputMaybe; - imageUrl?: InputMaybe; - maximumFatePoints?: InputMaybe; - maximumHealth?: InputMaybe; - maximumMana?: InputMaybe; - name?: InputMaybe; + currentFatePoints?: InputMaybe; + currentHealth?: InputMaybe; + currentMana?: InputMaybe; + hasFatePoints?: InputMaybe; + hasMana?: InputMaybe; + imageUrl?: InputMaybe; + maximumFatePoints?: InputMaybe; + maximumHealth?: InputMaybe; + maximumMana?: InputMaybe; + name?: InputMaybe; }; export type CreateCharacterResult = CreateCharacterSuccess | Error; export type CreateCharacterSuccess = { - __typename?: 'CreateCharacterSuccess'; - editHash: Scalars['String']; + __typename?: "CreateCharacterSuccess"; + editHash: Scalars["String"]; }; export type Error = { - __typename?: 'Error'; - reason: Scalars['String']; + __typename?: "Error"; + reason: Scalars["String"]; }; export type Mutation = { - __typename?: 'Mutation'; + __typename?: "Mutation"; createCharacter: CreateCharacterResult; - updateCharacter?: Maybe; + updateCharacter?: Maybe; }; - export type MutationUpdateCharacterArgs = { input: UpdateCharacterInput; }; export type Query = { - __typename?: 'Query'; + __typename?: "Query"; character?: Maybe; characterEditor?: Maybe; }; - export type QueryCharacterArgs = { - id: Scalars['ID']; + id: Scalars["ID"]; }; - export type QueryCharacterEditorArgs = { - editHash: Scalars['ID']; + editHash: Scalars["ID"]; }; export type UpdateCharacterInput = { - editHash: Scalars['String']; + editHash: Scalars["String"]; updates: CharacterUpdateFields; }; export type CharacterQueryQueryVariables = Exact<{ - characterId: Scalars['ID']; + characterId: Scalars["ID"]; }>; - -export type CharacterQueryQuery = { __typename?: 'Query', character?: ( - { __typename?: 'Character', id: string } - & { ' $fragmentRefs': { 'CharacterViewFragmentFragment': CharacterViewFragmentFragment;'CharacterOverlayFragmentFragment': CharacterOverlayFragmentFragment } } - ) | null | undefined }; - -export type CharacterViewFragmentFragment = { __typename?: 'Character', id: string, name: string, imageUrl?: string | null | undefined, maximumHealth: number, currentHealth: number, hasMana: boolean, maximumMana: number, currentMana: number, hasFatePoints: boolean, maximumFatePoints: number, currentFatePoints: number } & { ' $fragmentName': 'CharacterViewFragmentFragment' }; +export type CharacterQueryQuery = { + __typename?: "Query"; + character?: + | ({ __typename?: "Character"; id: string } & { + " $fragmentRefs": { + CharacterViewFragmentFragment: CharacterViewFragmentFragment; + CharacterOverlayFragmentFragment: CharacterOverlayFragmentFragment; + }; + }) + | null + | undefined; +}; export type CharacterEditorQueryQueryVariables = Exact<{ - editHash: Scalars['ID']; + editHash: Scalars["ID"]; }>; - -export type CharacterEditorQueryQuery = { __typename?: 'Query', characterEditor?: { __typename: 'CharacterEditorView', character: ( - { __typename?: 'Character', id: string } - & { ' $fragmentRefs': { 'CharacterViewFragmentFragment': CharacterViewFragmentFragment } } - ) } | { __typename: 'Error', reason: string } | null | undefined }; +export type CharacterEditorQueryQuery = { + __typename?: "Query"; + characterEditor?: + | { + __typename: "CharacterEditorView"; + character: { __typename?: "Character"; id: string } & { + " $fragmentRefs": { + CharacterViewFragmentFragment: CharacterViewFragmentFragment; + }; + }; + } + | { __typename: "Error"; reason: string } + | null + | undefined; +}; export type UpdateCharacterMutationMutationVariables = Exact<{ input: UpdateCharacterInput; }>; +export type UpdateCharacterMutationMutation = { + __typename?: "Mutation"; + updateCharacter?: boolean | null | undefined; +}; -export type UpdateCharacterMutationMutation = { __typename?: 'Mutation', updateCharacter?: boolean | null | undefined }; - -export type CharacterOverlayFragmentFragment = { __typename?: 'Character', id: string, name: string, currentHealth: number, maximumHealth: number, hasMana: boolean, currentMana: number, maximumMana: number, hasFatePoints: boolean, currentFatePoints: number, maximumFatePoints: number, imageUrl?: string | null | undefined } & { ' $fragmentName': 'CharacterOverlayFragmentFragment' }; +export type CharacterViewFragmentFragment = { + __typename?: "Character"; + id: string; + name: string; + imageUrl?: string | null | undefined; + maximumHealth: number; + currentHealth: number; + hasMana: boolean; + maximumMana: number; + currentMana: number; + hasFatePoints: boolean; + maximumFatePoints: number; + currentFatePoints: number; +} & { " $fragmentName": "CharacterViewFragmentFragment" }; -export type CreateCharacterMutationMutationVariables = Exact<{ [key: string]: never; }>; +export type CharacterOverlayFragmentFragment = { + __typename?: "Character"; + id: string; + name: string; + currentHealth: number; + maximumHealth: number; + hasMana: boolean; + currentMana: number; + maximumMana: number; + hasFatePoints: boolean; + currentFatePoints: number; + maximumFatePoints: number; + imageUrl?: string | null | undefined; +} & { " $fragmentName": "CharacterOverlayFragmentFragment" }; +export type CreateCharacterMutationMutationVariables = Exact<{ + [key: string]: never; +}>; -export type CreateCharacterMutationMutation = { __typename?: 'Mutation', createCharacter: { __typename: 'CreateCharacterSuccess', editHash: string } | { __typename: 'Error', reason: string } }; +export type CreateCharacterMutationMutation = { + __typename?: "Mutation"; + createCharacter: + | { __typename: "CreateCharacterSuccess"; editHash: string } + | { __typename: "Error"; reason: string }; +}; -export const CharacterViewFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CharacterViewFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Character"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"imageUrl"}},{"kind":"Field","name":{"kind":"Name","value":"maximumHealth"}},{"kind":"Field","name":{"kind":"Name","value":"currentHealth"}},{"kind":"Field","name":{"kind":"Name","value":"hasMana"}},{"kind":"Field","name":{"kind":"Name","value":"maximumMana"}},{"kind":"Field","name":{"kind":"Name","value":"currentMana"}},{"kind":"Field","name":{"kind":"Name","value":"hasFatePoints"}},{"kind":"Field","name":{"kind":"Name","value":"maximumFatePoints"}},{"kind":"Field","name":{"kind":"Name","value":"currentFatePoints"}}]}}]} as unknown as DocumentNode; -export const CharacterOverlayFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CharacterOverlayFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Character"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"currentHealth"}},{"kind":"Field","name":{"kind":"Name","value":"maximumHealth"}},{"kind":"Field","name":{"kind":"Name","value":"hasMana"}},{"kind":"Field","name":{"kind":"Name","value":"currentMana"}},{"kind":"Field","name":{"kind":"Name","value":"maximumMana"}},{"kind":"Field","name":{"kind":"Name","value":"hasFatePoints"}},{"kind":"Field","name":{"kind":"Name","value":"currentFatePoints"}},{"kind":"Field","name":{"kind":"Name","value":"maximumFatePoints"}},{"kind":"Field","name":{"kind":"Name","value":"imageUrl"}}]}}]} as unknown as DocumentNode; -export const CharacterQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CharacterQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"characterId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"directives":[{"kind":"Directive","name":{"kind":"Name","value":"live"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"character"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"characterId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"CharacterViewFragment"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"CharacterOverlayFragment"}}]}}]}},...CharacterViewFragmentFragmentDoc.definitions,...CharacterOverlayFragmentFragmentDoc.definitions]} as unknown as DocumentNode; -export const CharacterEditorQueryDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CharacterEditorQuery"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"editHash"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"directives":[{"kind":"Directive","name":{"kind":"Name","value":"live"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"characterEditor"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"editHash"},"value":{"kind":"Variable","name":{"kind":"Name","value":"editHash"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Error"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"reason"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CharacterEditorView"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"character"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"CharacterViewFragment"}}]}}]}}]}}]}},...CharacterViewFragmentFragmentDoc.definitions]} as unknown as DocumentNode; -export const UpdateCharacterMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCharacterMutation"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateCharacterInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateCharacter"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]} as unknown as DocumentNode; -export const CreateCharacterMutationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateCharacterMutation"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createCharacter"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Error"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"reason"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CreateCharacterSuccess"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"editHash"}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const CharacterViewFragmentFragmentDoc = { + kind: "Document", + definitions: [ + { + kind: "FragmentDefinition", + name: { kind: "Name", value: "CharacterViewFragment" }, + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "Character" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "name" } }, + { kind: "Field", name: { kind: "Name", value: "imageUrl" } }, + { kind: "Field", name: { kind: "Name", value: "maximumHealth" } }, + { kind: "Field", name: { kind: "Name", value: "currentHealth" } }, + { kind: "Field", name: { kind: "Name", value: "hasMana" } }, + { kind: "Field", name: { kind: "Name", value: "maximumMana" } }, + { kind: "Field", name: { kind: "Name", value: "currentMana" } }, + { kind: "Field", name: { kind: "Name", value: "hasFatePoints" } }, + { kind: "Field", name: { kind: "Name", value: "maximumFatePoints" } }, + { kind: "Field", name: { kind: "Name", value: "currentFatePoints" } }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const CharacterOverlayFragmentFragmentDoc = { + kind: "Document", + definitions: [ + { + kind: "FragmentDefinition", + name: { kind: "Name", value: "CharacterOverlayFragment" }, + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "Character" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { kind: "Field", name: { kind: "Name", value: "name" } }, + { kind: "Field", name: { kind: "Name", value: "currentHealth" } }, + { kind: "Field", name: { kind: "Name", value: "maximumHealth" } }, + { kind: "Field", name: { kind: "Name", value: "hasMana" } }, + { kind: "Field", name: { kind: "Name", value: "currentMana" } }, + { kind: "Field", name: { kind: "Name", value: "maximumMana" } }, + { kind: "Field", name: { kind: "Name", value: "hasFatePoints" } }, + { kind: "Field", name: { kind: "Name", value: "currentFatePoints" } }, + { kind: "Field", name: { kind: "Name", value: "maximumFatePoints" } }, + { kind: "Field", name: { kind: "Name", value: "imageUrl" } }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const CharacterQueryDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "query", + name: { kind: "Name", value: "CharacterQuery" }, + variableDefinitions: [ + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "characterId" }, + }, + type: { + kind: "NonNullType", + type: { kind: "NamedType", name: { kind: "Name", value: "ID" } }, + }, + }, + ], + directives: [ + { kind: "Directive", name: { kind: "Name", value: "live" } }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "character" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "id" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "characterId" }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "id" } }, + { + kind: "FragmentSpread", + name: { kind: "Name", value: "CharacterViewFragment" }, + }, + { + kind: "FragmentSpread", + name: { kind: "Name", value: "CharacterOverlayFragment" }, + }, + ], + }, + }, + ], + }, + }, + ...CharacterViewFragmentFragmentDoc.definitions, + ...CharacterOverlayFragmentFragmentDoc.definitions, + ], +} as unknown as DocumentNode; +export const CharacterEditorQueryDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "query", + name: { kind: "Name", value: "CharacterEditorQuery" }, + variableDefinitions: [ + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "editHash" }, + }, + type: { + kind: "NonNullType", + type: { kind: "NamedType", name: { kind: "Name", value: "ID" } }, + }, + }, + ], + directives: [ + { kind: "Directive", name: { kind: "Name", value: "live" } }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "characterEditor" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "editHash" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "editHash" }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "__typename" } }, + { + kind: "InlineFragment", + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "Error" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "reason" }, + }, + ], + }, + }, + { + kind: "InlineFragment", + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "CharacterEditorView" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "character" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "id" }, + }, + { + kind: "FragmentSpread", + name: { + kind: "Name", + value: "CharacterViewFragment", + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ...CharacterViewFragmentFragmentDoc.definitions, + ], +} as unknown as DocumentNode< + CharacterEditorQueryQuery, + CharacterEditorQueryQueryVariables +>; +export const UpdateCharacterMutationDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "mutation", + name: { kind: "Name", value: "UpdateCharacterMutation" }, + variableDefinitions: [ + { + kind: "VariableDefinition", + variable: { + kind: "Variable", + name: { kind: "Name", value: "input" }, + }, + type: { + kind: "NonNullType", + type: { + kind: "NamedType", + name: { kind: "Name", value: "UpdateCharacterInput" }, + }, + }, + }, + ], + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "updateCharacter" }, + arguments: [ + { + kind: "Argument", + name: { kind: "Name", value: "input" }, + value: { + kind: "Variable", + name: { kind: "Name", value: "input" }, + }, + }, + ], + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + UpdateCharacterMutationMutation, + UpdateCharacterMutationMutationVariables +>; +export const CreateCharacterMutationDocument = { + kind: "Document", + definitions: [ + { + kind: "OperationDefinition", + operation: "mutation", + name: { kind: "Name", value: "CreateCharacterMutation" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "createCharacter" }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { kind: "Field", name: { kind: "Name", value: "__typename" } }, + { + kind: "InlineFragment", + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "Error" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "reason" }, + }, + ], + }, + }, + { + kind: "InlineFragment", + typeCondition: { + kind: "NamedType", + name: { kind: "Name", value: "CreateCharacterSuccess" }, + }, + selectionSet: { + kind: "SelectionSet", + selections: [ + { + kind: "Field", + name: { kind: "Name", value: "editHash" }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode< + CreateCharacterMutationMutation, + CreateCharacterMutationMutationVariables +>;