Commit Graph

166 Commits

Author SHA1 Message Date
Jason Kuhrt 122b0e17b0
feat: base hasNextPage in connectionPlugin upon gt not gte (#458)
closes #392

BREAKING CHANGE:

Remember that internally Nexus Schema over-fetches by 1 but hides this internally.

It used to be that `SomeEdge.hasNextPage` would be `true` _if_ the number of returned nodes was greater-than OR equal-to the `first` arg value given in the query.

Now when Nexus Schema treats the `equal-to` case as `SomeEdge.hasNextPage` being `false`.

Co-authored-by: Eyal Wiener <eyalwiener@gmail.com>
2020-07-01 16:16:09 -04:00
Leonardo Dino 5b900b156a
fix(connectionPlugin): allow first and last to be zero (#436)
Co-authored-by: Jason Kuhrt <jason.kuhrt@dialogue.co>
2020-07-01 14:49:09 -04:00
Jason Kuhrt bf0df64ebd
tests: add windows to os matrix (#405) 2020-06-10 10:02:04 -04:00
Jason Kuhrt 17fad3a78a chore: update snapshots 2020-04-07 11:19:59 -04:00
Jason Kuhrt cd08bb2a6d refactor: update lang headers 2020-04-07 11:14:08 -04:00
Jason Kuhrt 3156f9bc46 refactor(style): sort imports 2020-04-07 08:19:45 -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 8b1a760019 feat: switch over to component package 2020-03-30 14:47:35 -04:00
Jason Kuhrt 5f7c9708a4 Revert "feat: make sdl-converter use component package"
This reverts commit ec7f22a868.
2020-03-30 14:17:08 -04:00
Jason Kuhrt ec7f22a868 feat: make sdl-converter use component package 2020-03-30 14:11:52 -04: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
Lukáš Huvar 2f4107ebbb
feat: add name to fieldConfig (#368) 2020-02-10 18:49:52 -05:00
Tim Griesser 2090a6ae36
Fix iteration if # nodes requested > connection length (#365) 2020-01-22 21:35:43 -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 88b96042cc
fix: #361, error when using interfaceType & implements (#362)
* fix: #361, error when using interfaceType & implements

* Fix coverage, improve coverage in a few other places while we're here
2020-01-22 15:31:01 -05:00
Dan Lepadatu 6244c4f63a Update warn message when specifying .list and list: true for inputObject (#352) 2019-12-20 09:42:39 -05:00
Tim Griesser 8c9c29aa9c
feat: Add customPrintSchemaFn to makeSchema config (#326)
* feat: Add customPrintSchemaFn to makeSchema config

* Add the code to make the new option work correctly
2019-11-20 08:09:47 -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
Jason Kuhrt bac64560e7
feat(plugins): onInstall hook (#236) 2019-10-16 22:55:53 +02:00
Jason Kuhrt 62a6006c64 tests: remove invalid case
Being able to build with type checking on but without typegen is not
inteded to be supported. The following workflows for example are:

1. --transpile-only development builds
2. IDE feedback based on types + typegen
3. production builds where no --transpile-only check is used, based on types + typegen
2019-10-16 22:41:51 +02:00
Jason Kuhrt 573096eff9 fix(typegen): correct default typegen @types path! 2019-10-07 21:51:44 -04:00
Jason Kuhrt 80f1e69f9e chore: fix tests 2019-10-07 21:39:42 -04:00
Jason Kuhrt eb963da09e
feat(config): env var for should-generate-artifacts (#244)
This allows setting the `shouldGenerateArtifacts` config option by env var `NEXUS_SHOULD_GENERATE_ARTIFACTS`
2019-10-07 20:59:15 -04:00
Jason Kuhrt 9ceb53216a
feat(typegen): nicer generated package name (#248)
* feat(typegen): nicer generated package name

This can impact the end-user when they, for example, are using the `types` TS compiler option. In that situation, expressing a whitelist of TypeScript type-packages, in a Nexus app, it would be important that the user also include typegen or else tsc would stop seeing it (forcing the
user to do Nexus typegen config). To make it easier for users to do that, this change allows them refer to a pretty name, rather than something hard to predict, remember, and ugly looking.
2019-10-07 20:51:28 -04:00
Jason Kuhrt 10f5198021
refactor: clean up config processing & tests (#246)
* refactor: clean up config processing & tests

* refactor
2019-10-04 11:09:22 -04:00
Jason Kuhrt aa41026438 fix(config): correct default output paths 2019-10-03 20:34:11 -04:00
Jason Kuhrt 013a606548
feat: by default typegen as an @types package (#230) 2019-10-03 14:25:01 -04:00
Jason Kuhrt 7a3750b025
chore: simplify tsconfig (#240) 2019-10-03 12:37:46 -04:00
Jason Kuhrt 9727c0ee86 chore: apply prettier to test code 2019-09-27 09:12:54 -04:00
Jason Kuhrt e2b75fc36d
refactor: simplify integration test (#228) 2019-09-23 16:35:34 -04:00
Tim Griesser 79788ba874
Remove file:. from devDependencies (#227) 2019-09-23 15:07:30 -04:00
Tim Griesser 9f4ab9d830
Improving code coverage (#225)
* Improving overall coverage
* Improve jest config
* Remove unused internal builder methods
* Prefer non-inline snapshots
2019-09-22 21:28:27 -04:00
Jason Kuhrt e24dd6fb93 docs: remove mention of @prisma/nexus 2019-09-02 21:18:39 -04:00
Jason Kuhrt 7aaea5ef4f
fix(dynamic): typegen for dynamicOutputProperty (#212) 2019-09-01 09:32:57 -04:00
Andrea Di Giorgi 8e3254d023 fix(sdl-converter): object description, enum member deprecation (#204) 2019-08-21 22:29:35 -04:00
Jason Kuhrt 38fe229a19
fix: type errors w/ simple typegens (#191) 2019-08-15 17:48:42 -04:00
Tim Griesser 41fe99dfed
Add dynamicObjectProperty, fix #161 (#178)
* Add dynamicObjectProperty, fix #161
2019-07-14 20:21:13 -04:00
Alejandro Estrada 5c8eb7a4b6 Fix inline functions for custom scalars (#174)
* Fix inline fuctions for custom scalars

* Add test to resolve custom scalar with inline function
2019-07-07 22:28:50 -04:00
Flavian Desverne 611a19b6a0
[RFR] Allow schema construction even with unknown types (#155)
* Allow schema construction even with unknown types

* Fix TS type errors
2019-06-26 19:39:24 +02:00
Pascal Sthamer b1089a5665 Fix wrong fieldName type on subscriptionField (and fix backingTypes.spec.ts) (#159)
* Fix wrong fieldName type on subscriptionField

Closes #158

* Try to fix backingTypes.spec.ts

* Remove unused NexusSchemaExtensions import
2019-06-19 11:08:25 +02:00
Tim Griesser c141ce2fce Allow referencing backing types via rootTypings in codegen 2019-06-11 08:38:22 -04:00
Rutger Hendrickx 459f3cfff1 Allow enum backing types (#142)
* Allow enums to have backing types

* Update typeMatch regex references

* Ignore const enums for backing-types.

* Allow native TS enum as members config

* Allow const enum backing types

* Add assertValidName for enum keys
2019-06-05 08:55:07 -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 09abed674a
.list on custom scalar type (#141)
* Fix #114 - .list on custom scalar type
2019-05-16 23:44:26 -04:00
Tim Griesser b1be4e2124
Fix #89, SDL converter for list w/ null items (#90) 2019-03-18 11:12:26 -04:00
Tim Griesser 48bb3e92b0 Fix nested nullability 2019-03-18 11:10:57 -04:00
Tim Griesser f1175c0c21
Add extendInputType (#54)
* Add extendInputType, fix #51
2019-02-22 17:29:01 -05:00
Tim Griesser ee1589ae8c
Fix #44, add correct typing for union types (#45) 2019-02-18 18:04:46 -05:00
Kento Moriwaki e6d6fa2611 Fix sdlConverter to export as commonjs (#42)
* Add specs to sdlConverter with commonjs option
* Use export const for esmodules
2019-02-18 10:48:42 -05:00
Tim Griesser c0612e692d Print unions correctly in SDL converter 2019-02-15 00:19:50 -05:00
Tim Griesser f090b6d596 Fix #27, #34 - general SDL converter cleanup 2019-02-15 00:02:30 -05:00
Tim Griesser faf4b6b3bb
Fix #33 (#39)
Fix #33, consistent t.list syntax for scalars & input fields
2019-02-14 23:18:37 -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 7df52ef597 Fix nonNullDefaults, internal cleanup 2019-02-02 17:44:06 -05:00
Tim Griesser 39c9f13ec3 Changing signature of makeSchemaInternal 2019-02-02 12:15:53 -05:00
Tim Griesser 5008603b66 First pass at SDL converter 2019-02-01 08:48:08 -05:00
Tim Griesser 1ec41ac2ba Update tests 2019-01-31 10:26:54 -05:00
Tim Griesser 28bfb96720 ScalarType asNexusMethod 2019-01-31 10:09:31 -05:00
Tim Griesser 97258f7d2c Changing core exports to include everything 2019-01-29 11:33:54 -05:00
Tim Griesser f95ffc303a Schema & type generation working again, need to cleanup the wrapping 2019-01-29 10:34:27 -05:00
Tim Griesser 9d2fd4bc05 Continuing to simplify internals 2019-01-28 12:56:34 -05:00
Tim Griesser 672a62cb76 WIP 2019-01-27 20:37:09 -05:00
Tim Griesser ccebe9f86d WIP 2019-01-26 16:00:53 -05:00
Tim Griesser 263de2ea18 WIP on schema gen. Removing concept of directive for now to strip down API surface area 2019-01-26 14:27:59 -05:00
Tim Griesser b8d23c30f3 Various API cleanup, trying to simplify overall concepts 2019-01-21 14:29:30 -05:00