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
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.
This PR removes the `nullable: boolean` and `list: boolean | boolean[]` API and replaces it with top-level type wrappers named: `list()`, `nonNull()` and `nullable()`
BREAKING CHANGES:
- `isTypeOf` is now the _default_ strategy to discriminate members of an abstract type. To keep using `resolveType` as you might have been before, enable the following config in `makeSchema`:
```ts
makeSchema({
features: {
abstractTypeStrategies: {
resolveType: true
}
}
})
```
fixes#402fixes#450
Fixes:
- Global connection field extensions were never executed
- Typings of global connection field extension (root, args and the resolver return type was wrong)
- Typings of local connection field extension (everything was any)
* Update CI config to test examples
* Fix star wars example
* Update yarn.lock of nexus-prisma example
* Fix kitchen-sink example
* Update nexus to beta9 in star wars example
* Upgrade nexus in ts-ast-reader example
* Fix ghost example
* Fix githunt-api example
* Make githunt-api test pass
* Fix nexus-prisma example
* Fix typing in ts-ast-reader
* Use yarn link when nexus deps is already 0.12.0-beta.9
* Remove yarn link from example_ghost
* Make sure generated files are up to date