Commit Graph

154 Commits

Author SHA1 Message Date
Tim Griesser 555ae79ded
fix: revert declareInputs default to false (#975) 2021-09-02 13:18:47 +00:00
Tim Griesser 380ed9d4ca
fix: correct imports for changes in #967 (#968)
* fix: correct imports for changes in #967
2021-08-17 19:35:56 -04:00
Tim Griesser 4531519e6c fix failing CI types 2021-07-21 12:19:17 -04:00
Philipp Strathausen 031c77257a
chore(docs): Fix prisma link in examples README (#912) 2021-05-25 19:32:31 -04:00
Tim Griesser 74c93e2ce4
refactor: add importsNotUsedAsValues: error to force import type (#872) 2021-03-27 16:26:13 -04:00
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
Ryan Chenkie b327841a63
chore(docs): update migrate commands (#792) 2021-01-19 09:17:22 -05:00
Jason Kuhrt 3f27f9e979 chore(docs): example MIT license 2021-01-07 13:06:05 -05:00
Jason Kuhrt 91c775e48a chore(docs): update example deps 2021-01-07 13:05:41 -05: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 306dbaae10
feat: .nonNull / .nullable chaining, additional cleanup (#655)
- 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>
2020-11-23 10:41:03 -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
Tim Griesser 36503f7bd1
chore: @tgriesser/schemats for simpler DB output in ghost example (#633) 2020-11-18 12:51:23 -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
Jason Kuhrt ca744420c5 chore: update zeit example 2020-11-09 13:46:23 -05:00
Jason Kuhrt f60938079a
improve: remove resolver shorthands (#592)
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.
2020-11-04 12:03:29 -05:00
Jason Kuhrt 9f01342248
improve: remove dynamic output builtins (#590)
closes #581 

BREAKING CHANGE:

`ext` is no longer exported. The `relayConnectionField` and `collectionField` dynamic output methods have been removed. In their place try the `connection` plugin.
2020-10-30 10:19:15 -04: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
Davy Hausser 980920a72a
chore(docs): fix for outdated prisma-labs link in the documentation #518 (#572) 2020-10-26 09:15:42 -04:00
Jason Kuhrt 2edfcfa629
fix: subscription type static typings (#564)
fixes #559
2020-10-20 11:13:08 -04:00
Tim Griesser b4e0debd95
feat: add onObjectDefinition / onInputObjectDefinition (#533) 2020-10-07 13:08:43 -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
Jan Piotrowski efa96cb113
feat: new docs site (#500)
Co-authored-by: Jason Kuhrt <jasonkuhrt@me.com>
Co-authored-by: Jason Kuhrt <jason.kuhrt@dialogue.co>
2020-09-30 12:25:39 +02:00
Jason Kuhrt 58c3ad9c12 chore: release changes 2020-09-22 13:46:16 -04:00
Jason Kuhrt 0ee644b234
feat(deps)!: upgrade to graphql v15 (#486)
closes #410

BREAKING CHANGE:

The graphql peer dep requirement has been bumped to v15.

No graphql v15 exclusive features have been shipped yet. But this update
sets us up to begin that work.

Support for graphql v14 and lower has been dropped. It may technically work
still (the test suite did not show any major reasons why it won't, for
now/currently) but there is no guarantee about that remaining so in the
future. Internally we are only testing against v15. Certain new grpahqljs
v15 features like interfaces being able to implement other interfaces will
be released in the future.

If you absolutely cannot upgrade from graphql v14 right now then stay with
@nexus/schema v15. But if you also really need a new @nexus/schema feature
on v16+ (future) then you can try your luck with it an older version of
graphqljs.
2020-08-07 16:12:15 -04:00
Jason Kuhrt 78af75686d
chore: format with prisma-labs prettier config (#461) 2020-07-01 23:42:06 -04:00
Matthew Leffler fe2553cf97
chore(docs): Update repo name in examples readme (#443) 2020-06-03 16:28:49 -04:00
Jason Kuhrt cd27481f61 chore: post-release update examples 2020-06-03 16:11:26 -04:00
Jason Kuhrt 57f1c7c249 chore: update example lock file, fix tests 2020-04-30 08:18:34 -04:00
Jason Kuhrt d74f9979d0 chore: examples update 2020-04-07 11:41:11 -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 00c1aad3ab chore: update examples, changelog 2020-03-30 16:35:21 -04:00
Jason Kuhrt fc627fdcd8
fix: schema component import refs (#403)
Also migrates to GH Actions away from CircleCI
2020-03-30 16:14:47 -04:00
Jason Kuhrt 7d4dba0515 docs: update examples to @nexus/schema 2020-03-30 15:03:06 -04:00
Jason Kuhrt 2505d21027 docs: remove old nexus-prisma example 2020-03-30 14:09:18 -04:00
Jason Kuhrt c705618795 chore: update examples 2020-03-19 20:38:12 -04:00
Tim Griesser d878c9d620 Bump local dependencies 2020-02-11 11:59:07 -05:00
Bjorn Lu 14fcbcdc22
feat: Add queryComplexityPlugin for query cost analysis (#369)
* Add graphql-query-complexity package

* Add query complexity plugin

* Add tests

* Add example

* Add docs

* Remove redundant async
2020-02-10 19:00:45 -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 cd25998259
chore: Clarify ts-node example so it doesn't fail on run #327 (#348) 2019-12-04 07:43:10 -05:00
Tim Griesser aa9a46fe48 chore(deps): Bump prettier to latest 2019-11-11 14:57:21 -05:00