-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
admin/Users: TSify, use GraphQL queries/mutations
- Loading branch information
Showing
23 changed files
with
2,069 additions
and
795 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
104 changes: 104 additions & 0 deletions
104
catalog/app/containers/Admin/Users/gql/UserCreate.generated.ts
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 |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core' | ||
import * as Types from '../../../../model/graphql/types.generated' | ||
|
||
import { | ||
UserResultSelection_User_Fragment, | ||
UserResultSelection_InvalidInput_Fragment, | ||
UserResultSelection_OperationError_Fragment, | ||
UserResultSelectionFragmentDoc, | ||
} from './UserResultSelection.generated' | ||
|
||
export type containers_Admin_Users_gql_UserCreateMutationVariables = Types.Exact<{ | ||
input: Types.UserInput | ||
}> | ||
|
||
export type containers_Admin_Users_gql_UserCreateMutation = { | ||
readonly __typename: 'Mutation' | ||
} & { | ||
readonly admin: { readonly __typename: 'AdminMutations' } & { | ||
readonly user: { readonly __typename: 'UserAdminMutations' } & { | ||
readonly create: | ||
| ({ readonly __typename: 'User' } & UserResultSelection_User_Fragment) | ||
| ({ | ||
readonly __typename: 'InvalidInput' | ||
} & UserResultSelection_InvalidInput_Fragment) | ||
| ({ | ||
readonly __typename: 'OperationError' | ||
} & UserResultSelection_OperationError_Fragment) | ||
} | ||
} | ||
} | ||
|
||
export const containers_Admin_Users_gql_UserCreateDocument = { | ||
kind: 'Document', | ||
definitions: [ | ||
{ | ||
kind: 'OperationDefinition', | ||
operation: 'mutation', | ||
name: { kind: 'Name', value: 'containers_Admin_Users_gql_UserCreate' }, | ||
variableDefinitions: [ | ||
{ | ||
kind: 'VariableDefinition', | ||
variable: { kind: 'Variable', name: { kind: 'Name', value: 'input' } }, | ||
type: { | ||
kind: 'NonNullType', | ||
type: { kind: 'NamedType', name: { kind: 'Name', value: 'UserInput' } }, | ||
}, | ||
}, | ||
], | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'admin' }, | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'user' }, | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'create' }, | ||
arguments: [ | ||
{ | ||
kind: 'Argument', | ||
name: { kind: 'Name', value: 'input' }, | ||
value: { | ||
kind: 'Variable', | ||
name: { kind: 'Name', value: 'input' }, | ||
}, | ||
}, | ||
], | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'FragmentSpread', | ||
name: { kind: 'Name', value: 'UserResultSelection' }, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
...UserResultSelectionFragmentDoc.definitions, | ||
], | ||
} as unknown as DocumentNode< | ||
containers_Admin_Users_gql_UserCreateMutation, | ||
containers_Admin_Users_gql_UserCreateMutationVariables | ||
> | ||
|
||
export { containers_Admin_Users_gql_UserCreateDocument as default } | ||
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# import UserResultSelection from "./UserResultSelection.graphql" | ||
|
||
mutation ($input: UserInput!) { | ||
admin { | ||
user { | ||
create(input: $input) { | ||
...UserResultSelection | ||
} | ||
} | ||
} | ||
} |
176 changes: 176 additions & 0 deletions
176
catalog/app/containers/Admin/Users/gql/UserDelete.generated.ts
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 |
---|---|---|
@@ -0,0 +1,176 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core' | ||
import * as Types from '../../../../model/graphql/types.generated' | ||
|
||
export type containers_Admin_Users_gql_UserDeleteMutationVariables = Types.Exact<{ | ||
name: Types.Scalars['String'] | ||
}> | ||
|
||
export type containers_Admin_Users_gql_UserDeleteMutation = { | ||
readonly __typename: 'Mutation' | ||
} & { | ||
readonly admin: { readonly __typename: 'AdminMutations' } & { | ||
readonly user: { readonly __typename: 'UserAdminMutations' } & { | ||
readonly mutate: Types.Maybe< | ||
{ readonly __typename: 'MutateUserAdminMutations' } & { | ||
readonly delete: | ||
| { readonly __typename: 'Ok' } | ||
| ({ readonly __typename: 'InvalidInput' } & { | ||
readonly errors: ReadonlyArray< | ||
{ readonly __typename: 'InputError' } & Pick< | ||
Types.InputError, | ||
'path' | 'message' | 'name' | 'context' | ||
> | ||
> | ||
}) | ||
| ({ readonly __typename: 'OperationError' } & Pick< | ||
Types.OperationError, | ||
'message' | 'name' | 'context' | ||
>) | ||
} | ||
> | ||
} | ||
} | ||
} | ||
|
||
export const containers_Admin_Users_gql_UserDeleteDocument = { | ||
kind: 'Document', | ||
definitions: [ | ||
{ | ||
kind: 'OperationDefinition', | ||
operation: 'mutation', | ||
name: { kind: 'Name', value: 'containers_Admin_Users_gql_UserDelete' }, | ||
variableDefinitions: [ | ||
{ | ||
kind: 'VariableDefinition', | ||
variable: { kind: 'Variable', name: { kind: 'Name', value: 'name' } }, | ||
type: { | ||
kind: 'NonNullType', | ||
type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } }, | ||
}, | ||
}, | ||
], | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'admin' }, | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'user' }, | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'mutate' }, | ||
arguments: [ | ||
{ | ||
kind: 'Argument', | ||
name: { kind: 'Name', value: 'name' }, | ||
value: { | ||
kind: 'Variable', | ||
name: { kind: 'Name', value: 'name' }, | ||
}, | ||
}, | ||
], | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'delete' }, | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: '__typename' }, | ||
}, | ||
{ | ||
kind: 'InlineFragment', | ||
typeCondition: { | ||
kind: 'NamedType', | ||
name: { kind: 'Name', value: 'InvalidInput' }, | ||
}, | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'errors' }, | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'path' }, | ||
}, | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'message' }, | ||
}, | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'name' }, | ||
}, | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'context' }, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
kind: 'InlineFragment', | ||
typeCondition: { | ||
kind: 'NamedType', | ||
name: { kind: 'Name', value: 'OperationError' }, | ||
}, | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'message' }, | ||
}, | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'name' }, | ||
}, | ||
{ | ||
kind: 'Field', | ||
name: { kind: 'Name', value: 'context' }, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
} as unknown as DocumentNode< | ||
containers_Admin_Users_gql_UserDeleteMutation, | ||
containers_Admin_Users_gql_UserDeleteMutationVariables | ||
> | ||
|
||
export { containers_Admin_Users_gql_UserDeleteDocument as default } | ||
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
mutation ($name: String!) { | ||
admin { | ||
user { | ||
mutate(name: $name) { | ||
delete { | ||
__typename | ||
... on InvalidInput { | ||
errors { | ||
path | ||
message | ||
name | ||
context | ||
} | ||
} | ||
... on OperationError { | ||
message | ||
name | ||
context | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.