Commit Graph

145 Commits

Author SHA1 Message Date
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
Tim Griesser bff7008a6b
chore: resolveType warning, restore declarativeWrapping list behavior (#658) 2020-11-23 14:41:59 -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
Jason Kuhrt 618521dea0
feat(config): SDL file generation by default in development (#652)
Co-authored-by: Tim Griesser <tgriesser10@gmail.com>

closes #632

BREAKING CHANGE:

SDL file generation will be enabled by default in development now.

If you were enabling it manually before and outputting to project root at `schema.graphql` You can probably now just rely on the default.

If you were relying on the default to disable SDL file generation before then now you need to pass an explicit false:

```ts
makeSchema({
  outputs: {
    schema: false
  }
})
```
2020-11-23 09:51:24 -05:00
Tim Griesser ab4b627acb
chore: Restore integration codegen removed in #629 and #630 (#654) 2020-11-21 17:02:58 -05:00
Tim Griesser 481e2c77fe
feat: Allow contextType to specify an TypingImport config (#606)
Co-authored-by: Flavian DESVERNE <flavian.desverne@epitech.eu>
Co-authored-by: Jason Kuhrt <jasonkuhrt@me.com>
2020-11-20 11:00:18 -05:00
Tim Griesser 4f4f9f49e8
feat(plugin): add onFieldDefinition / onArgDefinition / onInputFieldDefinition (#640) 2020-11-19 11:50:14 +01:00
Tim Griesser e2c88ea3f0 chore: fix types in nullabilityGuardPlugin spec 2020-11-18 22:59:37 -05:00
Tim Griesser 1e11720e00
chore: Refine exports for plugins (#639) 2020-11-18 22:06:32 -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