Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:prisma/nexus into develop
Browse files Browse the repository at this point in the history
* 'develop' of github.com:prisma/nexus:
  Fix mistakes in the example (#154)
  Allow dynamic method to be chainable (#153)
  • Loading branch information
tgriesser committed Jun 11, 2019
2 parents 06275f4 + 7b7e066 commit f127e48
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions docs/getting-started.md
Expand Up @@ -52,8 +52,9 @@ import {
interfaceType,
queryType,
stringArg,
enumType,
intArg,
fieldArg,
arg,
makeSchema,
} from "nexus";

Expand Down Expand Up @@ -85,7 +86,7 @@ const Query = queryType({
type: Account, // or "Account"
args: {
name: stringArg(),
status: fieldArg({ type: "StatusEnum" }),
status: arg({ type: "StatusEnum" }),
},
});
t.list.field("accountsById", {
Expand Down
4 changes: 2 additions & 2 deletions src/builder.ts
Expand Up @@ -1124,7 +1124,7 @@ export class SchemaBuilder {
// @ts-ignore
block[methodName] = (...args: any[]) => {
const config = isList ? [args[0], { list: isList, ...args[1] }] : args;
val.value.factory({
return val.value.factory({
args: config,
typeDef: block,
builder: this,
Expand All @@ -1142,7 +1142,7 @@ export class SchemaBuilder {
// @ts-ignore
block[methodName] = (...args: any[]) => {
const config = isList ? [args[0], { list: isList, ...args[1] }] : args;
val.value.factory({
return val.value.factory({
args: config,
typeDef: block,
builder: this,
Expand Down
4 changes: 2 additions & 2 deletions src/dynamicMethod.ts
Expand Up @@ -43,15 +43,15 @@ export interface DynamicOutputMethodConfig<T extends string>
/**
* Invoked when the field is called
*/
factory(config: OutputFactoryConfig<T>): void;
factory(config: OutputFactoryConfig<T>): any;
}

export interface DynamicInputMethodConfig<T extends string>
extends BaseExtensionConfig<T> {
/**
* Invoked when the field is called
*/
factory(config: InputFactoryConfig<T>): void;
factory(config: InputFactoryConfig<T>): any;
}

export class DynamicInputMethodDef<Name extends string> {
Expand Down

0 comments on commit f127e48

Please sign in to comment.