Skip to content

Commit

Permalink
Revert resolvers using tc.getTypeName() instead of directly passing t…
Browse files Browse the repository at this point in the history
…c for type
  • Loading branch information
jhbuchanan45 committed Jul 29, 2021
1 parent 7d29a85 commit 0167cb2
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/resolvers/createOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function createOne<TSource = any, TContext = any, TDoc extends Document =
t.setFields({
...payloadRecordId(tc, opts?.recordId),
record: {
type: tc.getTypeName(),
type: tc,
description: 'Created document',
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/dataLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function dataLoader<TSource = any, TContext = any, TDoc extends Document
const aliasesReverse = prepareAliasesReverse(model.schema);

return tc.schemaComposer.createResolver<TSource, TArgs>({
type: tc.getTypeName(),
type: tc,
name: 'dataLoader',
kind: 'query',
args: {
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/dataLoaderMany.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function dataLoaderMany<TSource = any, TContext = any, TDoc extends Docum
const aliasesReverse = prepareAliasesReverse(model.schema);

return tc.schemaComposer.createResolver<TSource, TArgs>({
type: '[' + tc.getTypeName() + ']!',
type: tc.List.NonNull,
name: 'dataLoaderMany',
kind: 'query',
args: {
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/findById.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function findById<TSource = any, TContext = any, TDoc extends Document =
// const typeTC = tc instanceof EDiscriminatorTypeComposer ? tc.getDInterface() : tc;

return tc.schemaComposer.createResolver<TSource, TArgs>({
type: tc.getTypeName(),
type: tc,
name: 'findById',
kind: 'query',
args: {
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/findByIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function findByIds<TSource = any, TContext = any, TDoc extends Document =
const aliasesReverse = prepareAliasesReverse(model.schema);

return tc.schemaComposer.createResolver<TSource, TArgs>({
type: '[' + tc.getTypeName() + '!]!',
type: tc.NonNull.List.NonNull,
name: 'findByIds',
kind: 'query',
args: {
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/findMany.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function findMany<TSource = any, TContext = any, TDoc extends Document =
const aliasesReverse = prepareAliasesReverse(model.schema);

return tc.schemaComposer.createResolver<TSource, TArgs>({
type: '[' + tc.getTypeName() + '!]!',
type: tc.NonNull.List.NonNull,
name: 'findMany',
kind: 'query',
args: {
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/findOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function findOne<TSource = any, TContext = any, TDoc extends Document = a
const aliasesReverse = prepareAliasesReverse(model.schema);

return tc.schemaComposer.createResolver<TSource, TArgs>({
type: tc.getTypeName(),
type: tc,
name: 'findOne',
kind: 'query',
args: {
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/removeById.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function removeById<TSource = any, TContext = any, TDoc extends Document
t.setFields({
...payloadRecordId(tc, opts?.recordId),
record: {
type: tc.getTypeName(),
type: tc,
description: 'Removed document',
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/removeOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function removeOne<TSource = any, TContext = any, TDoc extends Document =
t.setFields({
...payloadRecordId(tc, opts?.recordId),
record: {
type: tc.getTypeName(),
type: tc,
description: 'Removed document',
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/updateById.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function updateById<TSource = any, TContext = any, TDoc extends Document
t.setFields({
...payloadRecordId(tc, opts?.recordId),
record: {
type: tc.getTypeName(),
type: tc,
description: 'Updated document',
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/updateOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function updateOne<TSource = any, TContext = any, TDoc extends Document =
t.setFields({
...payloadRecordId(tc, opts?.recordId),
record: {
type: tc.getTypeName(),
type: tc,
description: 'Updated document',
},
});
Expand Down

0 comments on commit 0167cb2

Please sign in to comment.