Commit Graph

90 Commits

Author SHA1 Message Date
Nil Portugués Calderó c89c72bda2
chore(docs): Change --transpileOnly to --transpile-only from star-wars example (#859)
* Change --transpileOnly to --transpile-only
2021-03-15 07:40:41 -04:00
Jason Kuhrt 1ebae9f2a8 chore: update nexus ver in examples 2020-12-14 14:10:29 -05:00
Flavian Desverne 80ad53135c
improve!: rename package to nexus (#699)
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`.
2020-12-14 09:41:29 -05:00
Flavian Desverne d66e8f10d7 feat: rename typegenAutoConfig and rootTyping (#723)
BREAKING CHANGES:
- Renames `typegenAutoConfig` to `sourceTypes`
- Renames `typegenAutoConfig.sources` to `sourceTypes.modules`
- Renames `typegenAutoConfig.sources[].source` to `sourcesTypes.modules[].module`
- Renames `rootTyping` to `sourceType`
2020-12-10 19:23:23 +01:00
Flavian DESVERNE 642be8b69f feat: make contextType independent of source types
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`
2020-12-10 19:23:23 +01:00
Tim Griesser 9d0f4f4226
feat: add .asArg for enum, fix default typings (#708)
- 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
2020-12-06 18:52:04 -05:00
Tim Griesser 439864aabb
chore: Prettier on the codebase for JSDoc formatting (#706) 2020-12-06 15:47:58 -05:00
Tim Griesser bfcc959fd6
feat: add t.modify API for modifying inherited fields (#634)
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.
2020-11-18 21:58:14 -05:00
Flavian Desverne de832e79ca
feat: replace list & nullable API by type wrappers (#538)
This PR removes the `nullable: boolean` and `list: boolean | boolean[]` API and replaces it with top-level type wrappers named: `list()`, `nonNull()` and `nullable()`
2020-11-18 17:59:59 +01:00
Tim Griesser 9ba7d9b702
refactor: Simplify typegen with keyof and intersection types (#628) 2020-11-17 13:17:22 -05:00
Flavian Desverne 967d2df73e
feat: improve abstract types (#602)
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
    }
  }
})
```
2020-11-13 20:19:15 +01:00
Tim Griesser cc12ec16fb
fix: add deprecated, description, nullable to connectionField (#578) 2020-10-27 14:21:30 -04:00
Flavian Desverne de7cdfd396
fix: connection plugin (#569)
fixes #402
fixes #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)
2020-10-26 09:24:20 -04:00
Tim Griesser 8f3189c069
chore: Keep prettier config local to the project (#531) 2020-10-03 16:26:50 -04:00
Tim Griesser 2bceeb915f
chore: Bumping deps & adding scripts for running examples (#530) 2020-10-03 15:50:56 -04:00
Jason Kuhrt 78af75686d
chore: format with prisma-labs prettier config (#461) 2020-07-01 23:42:06 -04:00
Tim Griesser a10463e77c
chore: update lockfile entries (#404)
* chore: update lockfile entries
* fix: link-examples for website
2020-03-31 12:33:16 -04:00
Jason Kuhrt 7d4dba0515 docs: update examples to @nexus/schema 2020-03-30 15:03:06 -04:00
Tim Griesser d878c9d620 Bump local dependencies 2020-02-11 11:59:07 -05:00
Tim Griesser 4351a1d051
feat: Add connectionPlugin for relay style pagination (#324)
Adds `connectionsPlugin` for cursor style connections. These adhere to the Relay specification and offer plenty of options for customization:

https://facebook.github.io/relay/graphql/connections.htm
2020-01-22 20:17:17 -05:00
Tim Griesser aa9a46fe48 chore(deps): Bump prettier to latest 2019-11-11 14:57:21 -05:00
Tim Griesser 50bf2981e7
feat(epic): 0.12.0 Plugin System and Internal Refactor (#242)
See #242 for a full summary
2019-11-07 16:39:33 -05:00
dependabot[bot] 3b31920819 chore(deps): bump mixin-deep from 1.3.1 to 1.3.2 in /examples/star-wars (#300)
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-06 10:19:08 -05:00
Tim Griesser 17b9afb8ce
Cleanup codegen from examples to make plugins diff less noisy (#298) 2019-11-04 15:04:06 -05:00
Brice BERNARD 0a77f622e9 Test examples with CI (#220)
* 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
2019-09-21 16:12:03 -04:00
Tim Griesser c141ce2fce Allow referencing backing types via rootTypings in codegen 2019-06-11 08:38:22 -04:00
Tim Griesser 95e33976a3
Pass typeName to dynamic fields (#152) 2019-06-05 10:12:10 -04:00
Tim Griesser 1e932eb4b5
Initial pass at dynamic field inclusion/definition (#143)
* Initial pass at dynamic field inclusion/definition

* Split input/output custom fields, fixes #93 and #129

* Bump some lib versions

* Change around some dynamic field implementation details

* Make args override collection args

* Rename dynamicField -> dynamicMethod, export types from root

* Add decorateType, ability to specify rootType, fixes #17
2019-06-02 20:29:53 -04:00
Tim Griesser 342dccf265 Bumping TypeScript version for development 2019-05-18 18:01:56 -04:00
Tim Griesser 0060cb9ec7 Don't output the version number in typegen 2019-05-16 23:34:41 -04:00
Tim Griesser 6b3056a787 Upgrade examples dependencies 2019-03-10 13:40:54 -04:00
Tim Griesser 045c35fdab Bump example versions after release 2019-03-07 20:00:08 -05:00
Tim Griesser 18401c465a
Fix #68, allow nested input types, fix typings for input field default values (#72) 2019-03-07 19:38:14 -05:00
Tim Griesser 4e894c2081
Add mutationField shorthand helper (#58)
* Add mutationField helper, closes #46
2019-02-23 12:25:12 -05:00
Tim Griesser f1175c0c21
Add extendInputType (#54)
* Add extendInputType, fix #51
2019-02-22 17:29:01 -05:00
Tim Griesser 3991317383 Update examples 2019-02-22 14:54:10 -05:00
Tim Griesser 9af376746b Bump changelog, examples 2019-02-18 18:06:18 -05:00
Tim Griesser ee1589ae8c
Fix #44, add correct typing for union types (#45) 2019-02-18 18:04:46 -05:00
Tim Griesser 6ce4af08bb Bump examples 2019-02-15 13:14:38 -05:00
Tim Griesser fbe836a10f Bump examples for 0.9.12 2019-02-15 00:06:45 -05:00
Tim Griesser 18a306ee29 Update examples 2019-02-11 11:49:15 -05:00
Tim Griesser b1003b2fdf Bump version in examples 2019-02-11 09:04:37 -05:00
Tim Griesser 09fcb51b90 Update icons, bump examples 2019-02-05 13:54:24 -05:00
Tim Griesser 7830159417 TypegenConfigSourceModule: sources.module -> sources.source 2019-02-05 10:17:19 -05:00
Tim Griesser cab1931fe7 Update documentation & site 2019-02-05 02:33:57 -05:00
Tim Griesser d482283597 Bump examples 2019-02-03 21:05:45 -05:00
Tim Griesser 87932f785d Add new "ghost" example project (WIP) 2019-02-03 20:44:48 -05:00
Tim Griesser a74bcf3b14 Bump versions 2019-02-02 17:45:43 -05:00
Tim Griesser ba4427bc78 Bump versions 2019-02-02 16:16:14 -05:00
Tim Griesser 11588734ee Bump examples 2019-02-02 12:17:13 -05:00