Commit Graph

154 Commits

Author SHA1 Message Date
Tim Griesser 333dfb8757
feat: Add mergeSchema, better graphql-js interop (#983)
- Adds a new feature mergeSchema to the makeSchema config, to consume an external schema and merge with the locally defined Nexus types
- Standardizes the consumption of external GraphQLNamedType's so they are converted into Nexus type definitions, simplifying code paths
- Order of resolution goes from local Nexus types -> graphql-js types -> external schema types
- Adds asNexusMethod to all types, allowing for any commonly used types to be used as methods, not just scalars
- Convert methods / properties from protected -> private in Builder to better detect unused code
2021-09-06 09:32:43 -04:00
Tim Griesser 02a73b5d74
refactor: More internal cleanup (#981)
- Add Maybe on resolveType to match GraphQL signature
- Don't create placeholder Query type when renamed
- Internal rename rootTypings -> sourceTypings
2021-09-03 17:00:35 +00:00
Tim Griesser d4c6260774
feat: ability to rename root types (#976)
Closes #867
2021-09-02 09:38:16 -04:00
Tim Griesser 555ae79ded
fix: revert declareInputs default to false (#975) 2021-09-02 13:18:47 +00:00
Tim Griesser a003ff074f
fix: printer imports, follow up from #967 (#970) 2021-08-19 14:56:35 +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 5984ee122e
feat: ConfiguredTypegen for splitting global types & configuring input type emission (#967)
* feat: ConfiguredTypegen for splitting globals from other types
* default the declareInputs to true
2021-08-17 15:49:47 -04:00
Tim Griesser a914cc33d1
Revert "fix: #921 wrong typegen for nullable values w/ default (#965)" (#966)
This reverts commit 03b5ffd24a.
2021-08-17 13:50:36 -04:00
Tim Griesser 03b5ffd24a
fix: #921 wrong typegen for nullable values w/ default (#965)
* fix: #921 wrong typegen for nullable values w/ default

* refactor: make the conditional easier to follow
2021-08-04 10:59:50 -04:00
Jason Kuhrt df7d1370f9
feat: field config with name (#938) 2021-06-23 16:27:02 -04:00
Tim Griesser 81ec5c0f08
fix: Allow meta types to be wrapped with null/list (#935) 2021-06-19 13:36:07 -04:00
Tim Griesser 2b0708d675
refactor: TO_NEXUS -> NEXUS_TYPE / NEXUS_BUILD (#934) 2021-06-16 08:42:44 -04:00
Tim Griesser 2759c551c7
feat: TO_NEXUS symbol for adding types via metaprogramming (#932) 2021-06-14 17:37:30 -04:00
Tim Griesser 2e1c32b794
refactor: move makeSchema into separate file from builder (#927) 2021-06-09 11:40:53 -04:00
Jan Piotrowski 145f664914
chore(tests): update snapshots that were forgotten in #887 (#910) 2021-05-20 15:01:42 -04:00
Tim Griesser 74c93e2ce4
refactor: add importsNotUsedAsValues: error to force import type (#872) 2021-03-27 16:26:13 -04:00
Tim Griesser 27e35e51ee
fix: reduce iteration in connections (#843) 2021-02-24 13:25:56 -05:00
Tim Griesser aa283addcf
fix: invoke correct fn on global extended connection/edge (#814) 2021-02-01 11:15:32 -05:00
Tim Griesser 1f5b025837
fix: pass down source into extended connection fields (#812) 2021-01-31 23:04:03 -05:00
Tim Griesser fbcfba3165
feat: connectionPlugin internal modifications (#811)
- Adds `(root, ctx)` to `validateArgs`
- Iterate all nodes if neither `first` or `last` are provided, e.g. with custom `validateArgs`
- Export additional internal fns on `connectionPlugin`
2021-01-31 13:38:42 -05:00
Filip Stefansson bb936cb95c
feat: add plugin support for inputObjectType (#799) 2021-01-31 12:32:37 -05:00
Masayuki Izumi 666746c1df
feat: allow implementing interfaces in extendType (#774)
Co-authored-by: Jason Kuhrt <jason.kuhrt@dialogue.co>
Co-authored-by: Tim Griesser <tgriesser@gmail.com>
2021-01-26 09:33:38 -05:00
Tim Griesser af73f669f5
fix: Allow specifying overrides for builtin scalars (#795) 2021-01-22 10:21:07 -05:00
Miguel Oller 4f3cef9d38
feat: Add custom name options to Relay Connection plugin (#744) 2021-01-06 22:08:40 -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
Daniel Rearden ea989d5f7d
SDLConverter fixes (#717) 2020-12-09 10:38:24 -05:00
Daniel Rearden 8b3e88c1f6
feat: add support for interfaces implementing interfaces to sdlConverter (#713) 2020-12-08 15:45:21 -05:00
Tim Griesser dc1e21bdad
feat: pass connection args to field extensions (#710) 2020-12-07 17:02:36 -05:00
Tim Griesser 96368ab5c1
feat: allow arbitrary extensions on nexus types (#684)
Co-authored-by: Jason Kuhrt <jasonkuhrt@me.com>
2020-12-07 09:10:15 -05:00
Tim Griesser 0cff2205c3
feat: Don't force async if connection resolvers are sync (#707) 2020-12-06 19:23:57 -05: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
Jason Kuhrt 2c8102b37e
docs: cover objectType with jsdocs (#703) 2020-12-04 13:53:57 -05:00
Jason Kuhrt 242046c756
fix: subscriptionField overload for builder api access (#694)
closes #595
2020-12-02 11:53:55 -05:00
Jason Kuhrt 27d95d8a6f chore(docs): code sandbox for subscriptions
closes #594
2020-11-30 15:14:12 -05:00
Tim Griesser cf5b2695dc
feat: support graphql@^14.5 (#677) 2020-11-27 14:22:48 -05:00
Tim Griesser 6220d85513 fix: proper typings for edge extension 2020-11-27 13:09:10 -05:00
Tim Griesser 71ea266c9a feat: #479, allow promise to be returned from pageInfoFromNodes 2020-11-27 13:09:10 -05:00
Tim Griesser bb136009c0 feat: #399, add requireResolver: false
Will skip requiring global extension fields
2020-11-27 13:08:57 -05:00
Tim Griesser af7c06ce9d feat: #515, connection can accept non-String cursor 2020-11-27 13:08:50 -05:00
Tim Griesser 8d14709311 fix: #450 - custom edge fields not resolved 2020-11-27 13:05:36 -05:00
Tim Griesser 2dd90b4d87
fix: #618 Add inputFieldDefTypes for declarativeWrappingPlugin (#682) 2020-11-27 12:20:50 -05:00
Tim Griesser 24a78e8cf4
fix: #670 - explicit nullability for connectionPlugin (#671) 2020-11-25 09:49:27 -05:00
Tim Griesser 15515069c1
feat: Improved description for types on output method / output field (#666) 2020-11-24 11:40:55 -05:00
Tim Griesser 5ab7dd35d1
feat: Simplified upgrade path w/ better warning messages (#663)
Co-authored-by: Jason Kuhrt <jason.kuhrt@dialogue.co>
2020-11-24 11:40:38 -05:00
Tim Griesser 57bb5b078b
fix: Ensure we can modify nullability of an interface field (#662) 2020-11-23 22:13:59 -05:00
Tim Griesser 5c73102819
fix: Fix #622, custom scalars should work with interfaceType (#661) 2020-11-23 21:38:28 -05:00
Tim Griesser eb04d8f572
fix: SDL converter list/nonNull chaining (#660) 2020-11-23 16:52:17 -05:00