- Adds `(root, ctx)` to `validateArgs`
- Iterate all nodes if neither `first` or `last` are provided, e.g. with custom `validateArgs`
- Export additional internal fns on `connectionPlugin`
Co-authored-by: Jason Kuhrt <jasonkuhrt@me.com>
COMPLETES INITIAL DEVELOPMENT
BREAKING CHANGE:
You will now need to install Nexus Schema from the npm package `nexus` instead of `@nexus/schema`.
BREAKING CHANGES:
- `contextType` is no longer nested in `typegenAutoConfig`
- `contextType` can no longer references `sources` registered in `typegenAutoConfig`
- `contextType` API was refactored to use `module` instead of `path` and `export` instead of `name`
- `rootTyping` API was refactored to use `module` instead of `path` and `export` instead of `name`
- Renames `EnumTypeConfig` -> `NexusEnumTypeConfig` for consistency
- Adds `.asArg` on `enumType`, since these are often defined inline for one-off field args
- Fixes types so `default` type is properly inferred, eases types elsewhere so valid types which haven't been added to the manifest do not show as type errors
- Fixes SDL conversion
- Defer wrapping until types are built
- Supports GraphQL types anywhere that a type can be used, wrapped, etc.
- Split out the wrapping, w/ `finalizeWrapping` helper which adds in the `NonNull` to the list as needed
- Make `nonNull(nonNull(T))` & `nullable(nullable(T))` no-op for simplicity
- Change: `nullable(nonNull(T))` will undo the `nonNull`
- Properly type-check's `subscriptionType` by passing `Event` generic properly
- Adds `declarativeWrappingPlugin` for previous `nullable` / `list` behavior
Co-authored-by: Flavian DESVERNE <flavian.desverne@epitech.eu>
Co-authored-by: Tim Griesser <tgriesser10@gmail.com>
closes#632
BREAKING CHANGE:
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:
```ts
makeSchema({
outputs: {
schema: false
}
})
```
Adds `t.modify` API for modifying inherited types.
Use cases:
- If you have an `interface` type, but want to override the resolver or description for the field per-`objectType`
- If an inherited field's value is abstract, and you want to narrow it to a subtype which conforms to the inherited type
- If you want to add additional optional arguments for an inherited field, as is permitted by the spec
The types should validate that only fields inherited from interfaces can be modified, and the `type` can only be
changed if the result of that field is an abstract type which implements the existing inherited return type.