-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; | ||
import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core"; | ||
|
||
|
||
export type FragmentType<TDocumentType extends DocumentNode<any, any>> = TDocumentType extends DocumentNode< | ||
infer TType, | ||
any | ||
> | ||
? TType extends { ' $fragmentName': infer TKey } | ||
? TKey extends string | ||
? { ' $fragmentRefs': { [key in TKey]: TType } } | ||
export type FragmentType<TDocumentType extends DocumentNode<any, any>> = | ||
TDocumentType extends DocumentNode<infer TType, any> | ||
? TType extends { " $fragmentName": infer TKey } | ||
? TKey extends string | ||
? { " $fragmentRefs": { [key in TKey]: TType } } | ||
: never | ||
: never | ||
: never | ||
: never; | ||
|
||
: never; | ||
|
||
export function useFragment<TType>( | ||
_documentNode: DocumentNode<TType, any>, | ||
fragmentType: FragmentType<DocumentNode<TType, any>> | ||
): TType { | ||
return fragmentType as any | ||
return fragmentType as any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,45 @@ | ||
/* eslint-disable */ | ||
import * as graphql from './graphql'; | ||
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core'; | ||
import * as graphql from "./graphql"; | ||
import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core"; | ||
|
||
const documents = { | ||
"\n query CharacterQuery($characterId: ID!) @live {\n character(id: $characterId) {\n id\n ...CharacterViewFragment\n ...CharacterOverlayFragment\n }\n }\n": graphql.CharacterQueryDocument, | ||
"\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, | ||
"\n query CharacterQuery($characterId: ID!) @live {\n character(id: $characterId) {\n id\n ...CharacterViewFragment\n ...CharacterOverlayFragment\n }\n }\n": | ||
graphql.CharacterQueryDocument, | ||
"\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 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"]; | ||
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 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"]; | ||
|
||
export function gql(source: string): unknown; | ||
export function gql(source: string) { | ||
return (documents as any)[source] ?? {}; | ||
} | ||
|
||
export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never; | ||
export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = | ||
TDocumentNode extends DocumentNode<infer TType, any> ? TType : never; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from "./gql" | ||
export * from "./fragment-masking" | ||
export * from "./gql"; | ||
export * from "./fragment-masking"; |
64f931d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image has been published to DockerHub. 🐋
You can easily try this build out locally with Docker.
docker run -p 4000:4000 n1ru4l/character-overlay:64f931dc438e340e87e019770d3de9bed3f0f729