* Use ReadonlArray when generating output types
* Add useReadonlyArrayForInputs config and use it accordingly
* Update tests snapshots
* Move useReadonlyArrayForInputs in ConfiguredTypegen option
* Add tests for useReadonlyArrayForInputs
Co-authored-by: Jason Kuhrt <jasonkuhrt@me.com>
Co-authored-by: Tim Griesser <tgriesser10@gmail.com>
- Add Maybe on resolveType to match GraphQL signature
- Don't create placeholder Query type when renamed
- Internal rename rootTypings -> sourceTypings
- 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>
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
}
}
})
```
closes#582
As discussed. In most cases resolver shorthands are not a serious use of the API.
BREAKING CHANGE:
Resolver shorthand API is now removed. The following will now not typecheck:
```ts
t.string('foo', () => ... )
```
Instead use:
```ts
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.