t.model
Only available within objectType
definitions.
t.model
contains configurable field projectors that you use for projecting fields of your Prisma models onto your GraphQL Objects. The precise behaviour of field projectors vary by the Prisma type being projected. Refer to the respective sub-sections for details.
Model-object mapping
t.model
will either have field projectors for the Prisma model whose name matches that of the GraphQL Object
, or if the GraphQL Object
is of a name that does not match any of your Prisma models then t.model
becomes a function allowing you to specify the mapping, after which the field projectors become available.
Example
1model User {2 id String @id @default(cuid())3}
Enum
Auto-Projection
When a Prisma enum field is projected, the corresponding enum type will be automatically projected too (added to the GraphQL schema).
Member Customization
You can customize the projected enum members by defining the enum yourself in Nexus. nexus-plugin-prisma
will treat the name collision as an intent to override and so disable auto-projection.
Option Notes
Currently Prisma enums cannot be aliased (issue). They also cannot be type mapped since enum types cannot be mapped yet (issue).
Options
GraphQL Schema Contributions ?
1type M {2 MEF: E # ! <-- if not ? or @default3}45# if not defined by user6enum E {7 EV8}
Example
1model User {2 role Role3 mood Mood4}56enum Mood {7 HAPPY8 SAD9 CONFUSED10}1112enum Role {13 MEMBER14 EDITOR15 ADMIN16}
Scalar
Scalar Mapping
Prisma scalars are mapped to GraphQL scalars as follows:
1 Prisma GraphQL2 ------ -------3 Boolean <> Boolean4 String <> String5 Int <> Int6 Float <> Float7 Json <> Json (custom scalar)8 DateTime <> DateTime (custom scalar)9 cuid() <> ID10 uuid() <> UUID (custom scalar)
Auto-Projection
When a Prisma scalar is encountered that does not map to the standard GraphQL scalar types, it will be automatically projected (custom scalar added to the GraphQL schema). Examples include DateTime
and JSON
.
Option Notes
It is not possible to use type
because there is currently no way for a Prisma scalar to map to a differently named GraphQL scalar.
GraphQL Schema Contributions ?
1type M {2 MSF: S # ! <-- if not ? or @default3}45# if not matching a standard GQL scalar6scalar S
Options
Example
1model User {2 id String @id @default(cuid())3 email String4 scheduledPublish DateTime?5 rating Float6 active Boolean7}
Relation
Projecting relational fields only affects the current GraphQL object being defined. That is, the model that the field relates to is not auto-projected. This is a design choice intended to keep the nexus-plugin-prisma
system predictable for you. If you forget to project a relation you will receive feedback at build/boot time letting you know.
Options
GraphQL Schema Contributions ?
1type M {2 MRF: RM # ! <-- if not ?3}
Example
1model User {2 latestPost Post?3}45model Post {6 title String7 body String8}
List Enum
Like enums. It is not possible to order (issue) paginate (issue) or filter (issue) enum lists.
GraphQL Schema Contributions ?
1type M {2 MLEF: [E!]!3}45# if not defined by user6enum E {7 EV8}
List Scalar
Like scalars. It is not possible to order (issue) paginate (issue) or filter (issue) scalar lists.
GraphQL Schema Contributions ?
1type M {2 MLSF: [S!]!3}
List Relation
Like relations but also supports batch related options.
Options
type
alias
resolve
filtering
pagination
ordering
description
deprecation
GraphQL Schema Contributions ?
1type M {2 MLRF: [RM!]!3}
t.crud
t.crud
is an experimental feature. You must explicitly enable it via the plugin options.
Only available within GraphQL Query
and Mutation
definitions.
t.crud
contains configurable operation publishers that you use for exposing create, read, update, and delete mutations against your projected Prisma models.
There are 8 kinds of operations (reflecting a subset of Prisma Client's capabilities). An operation publisher is the combination of some operation kind and a particular Prisma model. Thus the number of operation publishers on t.crud
is Prisma model count × operation kind count
. So for example if you defined 20 Prisma models then you would see 160 operation publishers on t.crud
.
Example
1model User {2 ...3}
1queryType({2 definition(t) {3 t.crud.user()4 t.crud.users()5 },6})78mutationType({9 definition(t) {10 t.crud.createOneUser()11 t.crud.updateOneUser()12 t.crud.upsertOneUser()13 t.crud.deleteOneUser()1415 t.crud.updateManyUser()16 t.crud.deleteManyUser()17 },18})
Create
1t.crud.createOne<M>
Allow clients to create one record at at time of the respective Prisma model.
Relation fields may be connected with an existing record or a sub-create may be inlined (generally referred to as nested mutations). If the relation is a List
then multiple connections or sub-creates are permitted.
Inlined creates are very similar to top-level ones but have the important difference that the sub-create has excluded the field where supplying its relation to the type of parent Object
being created would normally be. This is because a sub-create forces its record to relate to the parent one.
Underlying Prisma Client Function
Options
GraphQL Schema Contributions ?
1mutation {2 createOne_M(data: M_CreateInput): M!3}45input M_CreateInput {6 MSF: S # ! <-- if not ? or @default7 MRF: RM_CreateManyWithout_M # ! <-- if not ? or @default8}910input RM_CreateManyWithout_M_Input {11 connect: [RM_WhereUniqueInput!]12 create: [RM_CreateWithout_M_Input!]13 connectOrCreate: [RM_CreateOrConnectWithout_M_Input]14}1516input RM_WhereUniqueInput {17 MRF@unique: S18}1920input RM_CreateOrConnectWithout_M_Input {21 where: RM_WhereUniqueInput!22 create: RM_CreateWithout_M_Input!23}2425input RM_CreateWithout_M_Input = RM_CreateInput - RMRF: M
Example
1model User {2 id Int @id3 email String @unique4 posts Post[]5}67model Post {8 id Int @id9 title String @unique10 body String11 author User12}
Read
1t.crud.<M>
Allow clients to find one particular record of the respective Prisma model. They may search by any Prisma model field that has been marked with @unique
attribute.
The ability for list fields to be filtered, ordered, or paginated depends upon if those features have been enabled for those GraphQL objects via t.model.<ListRelation>
.
Underlying Prisma Client function
Options
GraphQL Schema Contributions ?
1mutation {2 M(where: M_WhereUniqueInput): M!3}45input M_WhereUniqueInput {6 MF: S # if @unique7}
Example
1model User {2 id Int @id3 email String @unique4}
Update
1t.crud.updateOne<M>
Allow clients to update one particular record at a time of the respective Prisma model.
Underlying Prisma Client function
Options
GraphQL Schema Contributions ?
1mutation {2 updateOne_M(data: M_UpdateInput!, where: M_WhereUniqueInput!): M3}45input M_WhereUniqueInput {6 MF: S # if @unique7}89input M_UpdateInput {10 MFloatF: S_FieldUpdateOperationsInput # or Float if atomic operations are disabled11 MIntF: S_FieldUpdateOperationsInput # or Int if atomic operations are disabled12 MSF: S13 MRF: RM_UpdateManyWithout_M_Input14}1516input RM_UpdateManyWithout_M_Input {17 connect: [RM_WhereUniqueInput!]18 connectOrCreate: [RM_CreateOrConnectWithout_M_Input!]19 create: [RM_CreateWithout_M_Input!]20 delete: [RM_WhereUniqueInput!]21 deleteMany: [RM_ScalarWhereInput!] # see batch filtering reference22 disconnect: [RM_WhereUniqueInput!]23 set: [RM_WhereUniqueInput!]24 update: [RM_UpdateWithWhereUniqueWithout_M_Input!]25 updateMany: [RM_UpdateManyWithWhereNestedInput!]26 upsert: [RM_UpsertWithWhereUniqueWithout_M_Input!]27}2829input PostCreateOrConnectWithout_M_Input {30 create: RM_CreateWithout_M_Input!31 where: RM_WhereUniqueInput!32}3334input RM_WhereUniqueInput {} # recurse pattern like M_WhereUniqueInput3536input RM_CreateWithout_M_Input {} # RM_CreateInput - RMRF: M3738input RM_UpdateWithWhereUniqueWithout_M_Input {39 data: RM_UpdateWithout_M_Input!40 where: RM_WhereUniqueInput!41}42input RM_UpdateWithout_M_Input {43 RMSF: S44}4546input RM_UpdateManyWithWhereNestedInput {47 data: RM_UpdateManyInput!48 where: RM_ScalarWhereInput! # see batch filtering reference49}5051input RM_UpsertWithWhereUniqueWithout_M_Input {52 create: RM_CreateWithout_M_Input!53 update: RM_UpdateWithout_M_Input!54 where: RM_WhereUniqueInput!55}
For S_ScalarWhereInput
see batch filtering contributions.
Example
1model User {2 id Int @id3 email String @unique4 posts Post[]5}67model Post {8 id Int @id9 title String @unique10 body String11 author User12}
Upsert
1t.crud.upsertOne<M>
Allow clients to update or create (aka. insert) one particular record at a time of the respective Prisma model. This operation is a combination of create and update. The generated GraphQL mutation matches data
and where
args to those of update, and create
to that of data
arg in create. Unlike update, upsert guarantees a return value.
Underlying Prisma Client function
Options
GraphQL Schema Contributions ?
1mutation {2 upsertOne_M(3 create: M_CreateInput! # like createOne(data ...)4 data: M_UpdateInput! # like updateOne(data ...)5 where: M_WhereUniqueInput! # like updateOne(where ...)6 ): M!7}
For M_UpdateInput
and M_WhereUniqueInput
see update contributions.
For M_CreateInput
see create contributions.
Example
Delete
1t.crud.deleteOne<M>
Allow clients to delete one particular record at a time of the respective Prisma model.
Underlying Prisma Client function
Options
GraphQL Schema Contributions ?
1mutation {2 deleteOne_M(where: M_WhereUniqueInput): M3}45input M_WhereUniqueInput {6 MF@unique: S7}
Example
1model User {2 id Int @id3 email String @unique4 posts Post[]5}67model Post {8 id Int @id9 title String @unique10 body String11 author User12}
Batch Read
1t.crud.<M Pluralized>
Allow clients to fetch multiple records at once of the respective Prisma model.
Underlying Prisma Client Function
Options
type
alias
resolve
filtering
pagination
ordering
computedInputs
(local and global)
GraphQL Schema Contributions ?
1type Query {2 M_s: [M!]!3}
Example
1model User {2 id Int @id3 email String @unique4 posts Post[]5}67model Post {8 id Int @id9 title String @unique10 body String11 author User12}
Batch Update
1t.crud.updateMany<M>
Allow clients to update multiple records of the respective Prisma model at once. Unlike update
nested relation-updating is not supported here. Clients get back a BatchPayload
object letting them know the number of affected records, but not access to the fields of affected records.
Underlying Prisma Client Function
Options
GraphQL Schema Contributions ?
1mutation {2 updateMany_M(where: M_WhereInput, data: M_UpdateManyMutationInput): BatchPayload!3}45input M_UpdateManyMutationInput {6 MFloatF: S_FieldUpdateOperationsInput # or Float if atomic operations are disabled7 MIntF: S_FieldUpdateOperationsInput # or Int if atomic operations are disabled8 MSF: S9 MEF: E10 # not possible to batch update relations11}1213type BatchPayload {14 count: Int!15}
For M_WhereInput
see batch filtering contributions.
Example
1mutation updateManyUser(where: {...}, data: { status: ACTIVE }) {2 count3}
See filtering option example. Differences are: operation semantics (update things); return type; data
arg.
Batch Delete
1t.crud.deleteMany<M>
Allow clients to delete multiple records of the respective Prisma model at once. Clients get back a BatchPayload
object letting them know the number of affected records, but not access to the fields of affected records.
Underlying Prisma Client Function
Options
GraphQL Schema Contributions ?
1mutation {2 deleteMany_M(where: M_WhereInput): BatchPayload!3}45type BatchPayload {6 count: Int!7}
For M_WhereInput
see filtering contribution.
Example
1mutation {2 deleteManyUser(where: {...}) {3 count4 }5}
See filtering option example. Differences are: operation semantics (delete things); return type.
Options
alias
1undefined | String
Applies To
t.crud.<*>
t.model.<* - enum, list enum>
About
undefined
(default) By default Prisma model fields project onto GraphQL object fields of the same name.string
Change which GraphQL object field the Prisma model field projects onto.
GraphQL Schema Contributions ?
n/a
Example
1model Post {2 body String3}
type
1undefined | String
Applies To
t.crud.<*>
t.model.<Relation>
t.model.<ListRelation>
About
undefined
(default) Point Prisma field to a GraphQL object whose name matches that of the Prisma field model type.string
Point Prisma field to the given GraphQL object. This option can become necessary when you've have done model-object mapping and other Prisma models in your schema have relations to the name-mapped Prisma model. We are interested in developing further the model-object mapping API to automate this better (issue).
GraphQL Schema Contributions ?
n/a
Example
1model User {2 id String @id @default(cuid())3 posts Post[]4}56model Post {7 id String @id @default(cuid())8}
resolve
1undefined | (root: Root, args: Args, ctx: Context, info: GraphQLResolverInfo, originalResolve: <T>(root: Root, args: Args, ctx: Context, info: GraphQLResolverInfo): T) => T
Applies To
t.crud.<*>
t.model.<*>
About
Enable the usage of a custom resolver on any resolver generated by the plugin via t.crud
or t.model
.
You can either entirely replace the generated resolver, or wrap it via the use of the originalResolve
parameter.
Example
Adding custom business logic before and after a generated resolver
1queryType({2 definition(t) {3 t.crud.posts({4 async resolve(root, args, ctx, info, originalResolve) {5 console.log('logic before the resolver')6 const res = await originalResolve(root, args, ctx, info)7 console.log('logic after the resolver')8 return res9 },10 })11 },12})
ordering
1undefined | true | false | ModelWhitelist
Applies To
t.crud.<BatchRead>
t.model.<ListRelation>
About
Allow clients to order the records in a list field. Records can be ordered by their projected scalar fields in ascending or descending order. Ordering by fields on relations is not currently possible (issue).
undefined
(default) Likefalse
false
Disable orderingtrue
Enable ordering by all scalar fieldsModelWhitelist
(Record<string, true>
) Enable ordering by just Model scalar fields appearing in the given whitelist.
GraphQL Schema Contributions ?
1# t.crud.<BatchRead>2M(orderBy: [M_OrderByInput!])34# t.model.<ListRelation>5type M {6 MF(orderBy: [M_OrderByInput!])7}89input M_OrderByInput {10 MSF: OrderByArg11 # It is not possible to order by relations12}1314enum OrderByArg {15 asc16 desc17}
Example
1model User {2 id Int @id3 name String4 posts Post[]5}67model Post {8 id Int @id9 title String10 body String11}
pagination
1undefined | true | false
Applies to
t.crud.<BatchRead>
t.model.<ListRelation>
About
undefined
(default) Liketrue
true
Enable paginationfalse
Disable pagination
GraphQL Schema Contributions
1# t.crud.<BatchRead>2Ms(3 # The starting object for the list (typically ID or other unique value).4 after: M_WhereUniqueInput56 # The last object for the list (typically ID or other unique value)7 before: M_WhereUniqueInput89 # How many elements, forwards from `after` otherwise head10 first: Int1112 # How many elements, backwards from `before` otherwise tail13 last: Int1415 # The offset16 # If `first` used, then forwards from `after` (otherwise head)17 # If `last` used, then backwards from `before` (otherwise tail)18)1920# t.model.<ListRelation>21type M {22 MRF(after: M_WhereUniqueInput, before: M_WhereUniqueInput, first: Int, last: Int)23}2425input M_WhereUniqueInput {26 MSF@unique: S27}
Example
1model User {2 id Int @id3 posts Post[]4 // ...5}67model Post {8 id Int @id9 // ...10}
filtering
1undefined | true | false | ModelWhitelist
Applies to
t.crud.<BatchRead>
t.model.<ListRelation>
About
undefined
(default) Likefalse
true
Enable filtering for all scalar fieldsfalse
Disable filteringModelWhitelist
(Record<string, true>
) Enable ordering by just Model scalar fields appearing in the given whitelist.
GraphQL Schema Contributions ?
Example
1model User {2 id String @id @default(cuid())3 posts Post[]4 age Int5 status UserStatus6}78model Post {9 id String @id @default(cuid())10 author User11 comments Comment[]12 rating Float13}1415model Comment {16 id String @id @default(cuid())17 author User18 post Post19 content String20}2122enum UserStatus {23 BANNED24 ACTIVE25}
description
1undefined | string
Applies to
t.model.<*>
About
Sets a description to be included in the generated SDL for this field.
undefined
(default) No description will be added to the field.string
A description will be generated with the provided string.
Example
1model User {2 id Int @id3 name String4}
deprecation
1undefined | string
Applies to
t.model.<*>
About
Adds a @deprecated
directive to the generated SDL for this field.
undefined
(default) No deprecation directive will be added to the field.string
Include a deprecation directive, using the provided string as a reason.
Example
1model User {2 id Int @id3 name String4}
computedInputs
(local)
1Record<string, ({ args, ctx, info }: MutationResolverParams) => unknown>
Note: This is an abbreviated version of the ComputedInputs type. The most important thing to understand is that each of the object's values will be a function that takes an object with "args", "ctx", and "info" keys that represent the runtime values of the corresponding parameters that are passed to your resolver. For the full type, see ComputedInputs Type Details.
Applies to
About
Allow clients to omit fields from one mutation's corresponding input type and infer the value of those fields from the resolver's params (args, context, info) at runtime when determining what to pass to Prisma Client.
ComputedInputs
(Record<string, ({ args, ctx, info }: MutationResolverParams) => unknown>
) (full type here).Keys in the ComputedInputs object will be omitted from the mutation's corresponding input type. When resolving the mutation at runtime, each omitted key will be passed to Prisma Client based on the return value of that key's corresponding function in the ComputedInputs object when passed that resolver's parameters at runtime.
GraphQL Schema Contributions
The mutation's input type fields with a name that is in the ComputedInputs object are omitted from the GraphQL This modifies one existing input type but does not add new types or remove existing types.
Example
1model User {2 id Int @id3 name String4 createdWithBrowser String5}
computedInputs
(global)
1Record<string, ({ args, ctx, info}: MutationResolverParams) => any>
Note: This is an abbreviated version of the ComputedInputs type. The most important thing to understand each of the object's values will be a function that takes an object with "args", "ctx", and "info" keys that represent the runtime values of the corresponding parameters that are passed to your resolver. For the full type, see ComputedInputs Type Details.
Applies to
About
Allow clients to omit fields with a given name across all of their GraphQL schema's inputs and infer the value of those fields from context when determining what to pass to Prisma Client
ComputedInputs
(Record<string, ({ args, ctx, info }: MutationResolverParams) => any>
) (full type here).Keys in the ComputedInputs object will be omitted from all input types. When resolving any mutation at runtime, that mutation's input type will be recursively searched for the omitted keys. Any time one of those keys would have appeared anywhere in the mutation's input type, a value will be passed to Prisma Client based on the return value of that key's corresponding function in the ComputedInputs object when passed the resolver's parameters at runtime.
GraphQL Schema Contributions
All input type fields with a name that is in the ComputedInputs object are omitted from the GraphQL This modifies existing input types but does not add new types or remove existing types.
Example
1model User {2 id Int @id3 name String4 nested Nested[]5 createdWithBrowser String6}78model Nested {9 id Int @id10 name String11 createdWithBrowser String12}
If {user: {connect: {where: {id: 1}}}}
looks familiar, global computedInputs can also be used to determine the user making a request and automatically populate mutations affecting a single user accordingly. For example, assuming Prisma Client' context includes a "userId" key, adding a user key to global computedInputs can simplify the "createOneNested" mutation from the previous example:
1nexusPrismaPlugin({2 ...other config...3 computedInputs: {4 createdWithBrowser: ({ctx}) => ctx.browser,5 user: ({ctx}) => ({ connect: { where: { id: ctx.userId } } }),6 },7})
1mutation createOneNested {2 createOneNested({data: {name: "Moony"}}) {3 id4 name5 createdWithBrowser6 }7}
ComputedInputs
type details
1/**2 * Represents arguments required by Prisma Client that will3 * be derived from a request's input (root, args, and context)4 * and omitted from the GraphQL API. The object itself maps the5 * names of these args to a function that takes an object representing6 * the request's input and returns the value to pass to the Prisma Client7 * arg of the same name.8 */9export type LocalComputedInputs<MethodName extends MutationMethodName> = Record<10 string,11 (params: LocalMutationResolverParams<MethodName>) => unknown12>1314export type GlobalComputedInputs = Record<string, (params: GlobalMutationResolverParams) => unknown>1516type BaseMutationResolverParams = {17 info: GraphQLResolveInfo18 ctx: Context19}2021export type GlobalMutationResolverParams = BaseMutationResolverParams & {22 args: Record<string, any> & {23 data: unknown24 }25}2627export type LocalMutationResolverParams<28 MethodName extends MutationMethodName29> = BaseMutationResolverParams & {30 args: core.GetGen<'argTypes'>['Mutation'][MethodName]31}3233export type MutationMethodName = keyof core.GetGen<'argTypes'>['Mutation']3435export type Context = core.GetGen<'context'>
General System Behaviours
Null-Free Lists
Projection for Prisma list types always project as a fully non-nullable GraphQL type. This is because Prisma list fields (and list member type) can themselves never be null, and because Prisma does not support @default
on list types.
For consistency we also apply the same pattern for t.crud.<BatchRead>
.
Example
1model User {2 posts Post[]3}
Batch Filtering
Where Does it Appear?
1query {2 # When filtering option is enabled3 Ms(where: M_WhereInput, ...): [M!]!4}56mutation {7 updateMany_M(where: M_WhereInput, ...) BatchPayload!8 deleteMany_M(where: M_WhereInput): BatchPayload!9}1011type M {12 # When filtering option is enabled13 MRF: RM(where: RM_WhereInput): [RM!]!14}1516# Nested InputObjects from t.crud.update<M>1718# Nested InputObjects from t.crud.upsert<M>
What Structure Does it Have?
1input M_WhereInput {2 AND: [M_WhereInput!]3 NOT: [M_WhereInput!]4 OR: [M_WhereInput!]5 MSF: S_Filter6 MRF: RM_ListRelationFilter7}89input RM_ListRelationFilter {10 every: RM_WhereInput # recurse -> M_WhereInput11 none: RM_WhereInput # recurse -> M_WhereInput12 some: RM_WhereInput # recurse -> M_WhereInput13}1415# This type shows up in the context of t.crud.update<M> and t.crud.upsert<M>1617input RM_ScalarWhereInput {18 AND: [RM_ScalarWhereInput!]19 NOT: [RM_ScalarWhereInput!]20 OR: [RM_ScalarWhereInput!]21 RMSF: S_Filter22}
Scalar Filters
Patterns
There are few different scalar filter patterns. Some scalars share the same filter pattern.
String Like
1input S_Filter {2 contains: S3 endsWith: S4 equals: S5 gt: S6 gte: S7 in: [S!]8 lt: S9 lte: S10 not: Nested_S_Filter11 notIn: [S!]12 startsWith: S13}
Numeric Like
1input S_Filter {2 equals: S3 gt: S4 gte: S5 in: [S!]6 lt: S7 lte: S8 not: Nested_S_Filter9 notIn: [S!]10}
Boolean Like
1input S_Filter {2 equals: S3 not: Nested_S_Filter4}
S_NullableFilter
TODO
Nested_S_Filter
All nullable and non-nullable scalar filters have a recursive not
field of type Nested_S_Filter
. For example StringFilter
has not: NestedStringFilter
. In all cases this type is a mirror of the non-nested version. Why does it exist? Because in the future the root type may have additional filter settings that do not exist recursively. For example the mode
filter setting for string filters.
We have decided not to collapse the types even where possible. Instead we have opted for schema type pattern consistentcy. If you are interested in a future where we make an option to generate a GraphQL schema where scalar filters are collapsed where possible, please open an issue.
Scalars
Boolean
Refer to Boolean like filter.
String
Refer to String like filter.
Float
Refer to Numeric like filter.
DateTime
Refer to Numeric like filter. We are considering a tailored DateTime
filter.
ID
Refer to String like filter. We are considering a dedicated ID
filter type for consistentcy.
Json
TODO
S_FieldUpdateOperationsInput
This allows you to update the values of certain fields atomically. You can disable this behavior by setting atomicOperations
to false
in plugin settings.
Applies to
GraphQL Schema Contributions ?
1# S = Float | Int2# Only one operation can be done per field at a time.3input S_FieldUpdateOperationsInput {4 # Sets the value to S5 set: S6 # These fields only appear if "atomicNumberOperations" prisma client preview feature is enabled7 # Adds S to the current value8 increment: S9 # Subtracts S from the current value10 decrement: S11 # Multiplies the current value by S12 multiply: S13 # Divides the current value by S14 divide: S15}
GraphQL Schema Contributions Legend
How to read
Throughout this document you will see abbreviations used in GraphQL SDL syntax to signify how Nexus Prisma plugin contributes to the shape of your GraphQL schema. Each single capital letter is an abbreviation for one of the following things. When multiple capital letters are adjacent it means they combine the below.
1M = model F = field L = list S = scalar R = relation E = enum V = value
For example take this:
1input M_UpdateManyMutationInput { # 12 MFloatF: S_FieldUpdateOperationsInput # 2, 33 MIntF: S_FieldUpdateOperationsInput # 4, 54 MSF: S # 6, 75 MEF: E # 8, 96}
M_UpdateManyMutationInput
means a GraphQL object whose name is your model name with the suffixed withUpdateManyMutationInput
.MFloatF
means a model field of float typeS_FieldUpdateOperationsInput
means a GraphQL object type reference. The name will be the name of the scalar type of the field suffixed withFieldUpdateOperationsInput
. Since the field here is Float that means the object type name will beFloatFieldUpdateOperationsInput
.- Like point 2 but for
Int
- Like point 3 but for
Int
MSF
means a field name matching the field name of a model scalar field. Note it comes afterFloat
andInt
types have been explicitly listed, which means this excludes model fields of those types.S
means the type of this field will match the kind of model scalar that it is (see the Scalar mapping table to see what it will really be if in doubt)- Like (6) but for Enums
- Like (9) but for Enums