Skip to content

Commit

Permalink
fix: dynamic output property (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Aug 26, 2019
1 parent 8e3254d commit 67d9025
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ export class SchemaBuilder {
| GraphQLNamedType
| DynamicInputMethodDef<string>
| DynamicOutputMethodDef<string>
| DynamicOutputPropertyDef<string>
) {
if (isNexusDynamicInputMethod(typeDef)) {
this.dynamicInputFields[typeDef.name] = typeDef;
Expand Down Expand Up @@ -1362,7 +1363,8 @@ function addTypes(builder: SchemaBuilder, types: any) {
isNexusExtendInputTypeDef(types) ||
isNamedType(types) ||
isNexusDynamicInputMethod(types) ||
isNexusDynamicOutputMethod(types)
isNexusDynamicOutputMethod(types) ||
isNexusDynamicOutputProperty(types)
) {
builder.addType(types);
} else if (Array.isArray(types)) {
Expand Down
2 changes: 1 addition & 1 deletion src/definitions/wrapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export function isNexusDynamicOutputProperty<T extends string>(
): obj is DynamicOutputPropertyDef<T> {
return (
isNexusTypeDef(obj) &&
obj[NexusWrappedSymbol] === NexusTypes.DynamicOutputMethod
obj[NexusWrappedSymbol] === NexusTypes.DynamicOutputProperty
);
}
export function isNexusDynamicOutputMethod<T extends string>(
Expand Down
2 changes: 1 addition & 1 deletion src/dynamicProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class DynamicOutputPropertyDef<Name extends string> {
return this.config;
}
}
withNexusSymbol(DynamicOutputPropertyDef, NexusTypes.DynamicOutputMethod);
withNexusSymbol(DynamicOutputPropertyDef, NexusTypes.DynamicOutputProperty);

/**
* Defines a new property on the object definition block
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export {
FieldType,
} from "./typegenTypeHelpers";
export { dynamicInputMethod, dynamicOutputMethod } from "./dynamicMethod";
export { dynamicOutputProperty } from "./dynamicProperty";
export { core, blocks, ext };
import * as core from "./core";
import * as blocks from "./blocks";
Expand Down

0 comments on commit 67d9025

Please sign in to comment.