Skip to content

Commit

Permalink
try in example
Browse files Browse the repository at this point in the history
  • Loading branch information
JoviDeCroock committed Apr 16, 2023
1 parent b6693ff commit 40877fc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/example/src/Pokemon.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export type QueryPokemonArgs = {
export type FieldsFragment = {
__typename?: 'Pokemon';
classification?: string | null;
id: string;
};

export type PokemonFieldsFragment = {
Expand All @@ -130,6 +131,7 @@ export const FieldsFragmentDoc = {
kind: 'SelectionSet',
selections: [
{ kind: 'Field', name: { kind: 'Name', value: 'classification' } },
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
],
},
},
Expand Down
1 change: 1 addition & 0 deletions packages/example/src/Pokemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { gql } from '@urql/core';
export const fields = gql`
fragment fields on Pokemon {
classification
id
}
` as typeof import('./Pokemon.generated').FieldsFragmentDoc;

Expand Down
18 changes: 17 additions & 1 deletion packages/example/src/index.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export type PokemonsQuery = {
__typename: 'Pokemon';
id: string;
name: string;
fleeRate?: number | null;
} | null> | null;
};

Expand Down Expand Up @@ -170,6 +171,7 @@ export const PokemonsDocument = {
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
{ kind: 'Field', name: { kind: 'Name', value: 'name' } },
{ kind: 'Field', name: { kind: 'Name', value: '__typename' } },
{ kind: 'Field', name: { kind: 'Name', value: 'fleeRate' } },
{
kind: 'FragmentSpread',
name: { kind: 'Name', value: 'pokemonFields' },
Expand All @@ -180,7 +182,21 @@ export const PokemonsDocument = {
],
},
},
...PokemonFieldsFragmentDoc.definitions,
{
kind: 'FragmentDefinition',
name: { kind: 'Name', value: 'pokemonFields' },
typeCondition: {
kind: 'NamedType',
name: { kind: 'Name', value: 'Pokemon' },
},
selectionSet: {
kind: 'SelectionSet',
selections: [
{ kind: 'Field', name: { kind: 'Name', value: 'id' } },
{ kind: 'Field', name: { kind: 'Name', value: 'name' } },
],
},
},
],
} as unknown as DocumentNode<PokemonsQuery, PokemonsQueryVariables>;
export const PokemonDocument = {
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const PokemonsQuery = gql`
id
name
__typename
fleeRate
...pokemonFields
}
}
Expand Down

0 comments on commit 40877fc

Please sign in to comment.