Code-First, Type-Safe, GraphQL Schema Construction
mergeSchema
option, better graphql-js interop #983ReadonlyArray<T>
for enum members (#916)nexus
#699 → 80ad531
You will now need to install Nexus Schema from the npm package nexus instead of @nexus/schema.
0a43cbc
It is no longer permitted to pass null to description of enum, objects, args, input objects, interfaces, unions. Now you must pass either a string or nothing.
#730 → 78b8b08
resolveType
is no longer part of the APIdeclarativeWrappingPlugin
is no longer enabled by defaultScalarInputFieldConfig
type is removed#723 → d66e8f1
contextType
independent of source types642be8b
.asArg
for enum, fix default typings (#708)graphql@^14.5
(#677)pageInfoFromNodes
requireResolver: false
#652 → 618521d
SDL file generation will be enabled by default in development now.
If you were enabling it manually before and outputting to project root at schema.graphql
You can probably now just rely on the default.
If you were relying on the default to disable SDL file generation before then now you need to pass an explicit false:
makeSchema({
outputs: {
schema: false
}
})
#602 → 967d2df
New Abstract types system. Learn more at https://nxs.li/guides/abstract-types.
#538 → de832e7
#655 → 306dbaa
New API for specifying list and nullability types. Learn more at https://nexusjs.org/docs/api/list-nonNull.
t.modify
API for modifying inherited fields (#634)#592 → f609380
Resolver shorthand API is now removed. The following will now not typecheck:
t.string('foo', () => ... )
Instead use:
t.string('foo', { resolve: () => ... })
Runtime support is still intact but will result in a logged warning. Runtime support will be removed in the next Nexus release.
9f01342 → #590
ext
is no longer exported. The relayConnectionField
and collectionField
dynamic output methods have been removed. In their place try the connection
plugin.
9bfdf2c allow interfaces to implement other interfaces (#496)
b4e0deb add onObjectDefinition / onInputObjectDefinition (#533)
f8d164a error feedback if root typing path is invalid (#557)
This may be a breaking change if you were relying on pointing root typing path to a non-file for some reason in the past. We think for almost all users this will not be a breaking change however.
As Nexus Schema just made output types and list items nullable by default, there's a couple of changes you need to do to produce the same schema as before the update.
Changing global defaults to revert to non-nullable output types
import { makeSchema } from '@nexus/schema'
makeSchema({
+ nonNullDefaults: {
+ output: true
+ }
})
Changing type-level configuration to revert to non-nullable output types
import { objectType } from '@nexus/schema'
objectType({
name: 'User',
nonNullDefaults: {
+ output: true
}
definition(t) {
/* ... */
}
})
Updating lists output types to be non-nullable
import { objectType } from '@nexus/schema'
objectType({
name: 'User',
definition(t) {
t.field('posts', {
- list: true
+ list: [true]
})
}
})
1d97b78 allow asNexusMethod to specify TS type (#473)
The global TS type NexusGenRootTypes
no longer contains scalars. All scalars now live under a new global TS type named NexusGenScalars
.
// before
let foo: NexusGenRootTypes['String']
// after
let foo: NexusGenScalars['String']
122b0e1 base hasNextPage
in connectionPlugin upon gt not gte (#458)
1d97b78 (breaking) allow asNexusMethod to specify TS type (#473)
NexusGenScalars
for all scalar typesNexusGenRootTypes
(might be a breaking change, need review)NexusGenScalars
for all non specified (base GraphQL) scalars in input
and output
typesrootTyping
parameter to asNexusMethod
to allow the user to specify it, otherwise it will fallback to the backingTypeMap
903ceb8 add subscriptionType (#462)
ee7c371 use prettier api to load config (#460)
9c8e776 support typescript 3.9 (#459)
122b0e1 (breaking) base hasNextPage in connectionPlugin upon gt not gte (#458)