-
Notifications
You must be signed in to change notification settings - Fork 276
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
1 parent
c6a8399
commit 3531a31
Showing
9 changed files
with
738 additions
and
14 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
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,5 +1,44 @@ | ||
import { NexusObjectTypeConfig, objectType } from './objectType' | ||
|
||
/** | ||
* [2018 GraphQL Spec](https://spec.graphql.org/June2018/#sec-Mutation) | ||
* | ||
* Define a Mutation type. | ||
* | ||
* The Mutation type is one of three [root types](https://spec.graphql.org/June2018/#sec-Root-Operation-Types) | ||
* in GraphQL and its fields represent API operations your clients can run that may have side-effects. | ||
* | ||
* You can only have one of these in your schema. If you are going to modularize your schema and thus be | ||
* wanting to contribute fields to Mutation type from multiple modules then use | ||
* [mutationField](https://nxs.li/docs/api/mutation-field) intead. | ||
* | ||
* This is a shorthand for: | ||
* | ||
* `objectType({ name: 'Mutation' })` | ||
* | ||
* @example | ||
* mutationType({ | ||
* definitin(t) { | ||
* t.field('signup', { | ||
* type: 'User', | ||
* args: { | ||
* email: stringArg(), | ||
* }, | ||
* // ... | ||
* }) | ||
* t.field('buy', { | ||
* type: 'Recipet', | ||
* args: { | ||
* productId: idArg(), | ||
* }, | ||
* // ... | ||
* }) | ||
* }, | ||
* }) | ||
* | ||
* @param config Specify your Mutation type's fields, description, and more. See each config property's jsDoc | ||
* for more detail. | ||
*/ | ||
export function mutationType(config: Omit<NexusObjectTypeConfig<'Mutation'>, 'name'>) { | ||
return objectType({ ...config, name: 'Mutation' }) | ||
} |
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
Oops, something went wrong.