Code-First, Type-Safe, GraphQL Schema Construction
MIT License
Bot releases are visible (Hide)
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
Published by Weakky almost 4 years ago
#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]
})
}
})
Published by jasonkuhrt about 4 years ago
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)
Replaced Prisma reference
Updated copyright info
shouldGenerateArtifacts
(#1057)Update comment to reflect the current behavior as per src/typegenUtils.ts
Published by jasonkuhrt over 4 years ago
Published by jasonkuhrt over 4 years ago
See changelog
Published by tgriesser over 4 years ago
Adds connectionPlugin
for relay style pagination:
See: https://nexus.js.org/docs/plugin-connection and https://github.com/prisma-labs/nexus/pull/324 for more info
Published by tgriesser almost 5 years ago
customPrintSchemaFn
to makeSchema
configfeat(deps): Bumps the default minimum version of graphql-js to 14.5.0
Nexus uses the new extensions
property on types to store metadata provided to Nexus types, in order to make them usable by plugins.
feat: Adds "Plugins" API, see the docs for more info on what all these can help accomplish
feat(plugin): Add nullabilityGuardPlugin
. See the docs for more info
feat(plugin): Add fieldAuthorizePlugin
. See the docs for more info
This is the same behavior as before, but implemented more flexibly as a plugin. This will be
automatically added if no plugins are specified, otherwise it will need to be imported & added
to makeSchema
.
feat(schema): Adds shouldExitAfterGenerateArtifacts
option to makeSchema
The shouldExitAfterGenerateArtifacts
makes it possible to exit after the types are generated,
useful if you do not check a schema artifact into source control, but wish to generate before the code runs.
refactor: Removes nexusWrappedType
This was an internal implementation detail which should not affect end users
refactor: Removes t.modifyType
API
This may not have ever worked, it was only intended to modify fields on an objectType
which were
originally implemented by an interface. Please open an issue if this is a breaking change for you, so we
can understand the use-case and design a better API.
test: Improved code coverage, adds base threshold to new PRs