Skip to content

Commit

Permalink
Allow OGM selectionSet to be SelectionSetNode
Browse files Browse the repository at this point in the history
  • Loading branch information
darrellwarde committed Jul 28, 2021
1 parent b47e985 commit f46dedc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/ogm/src/classes/Model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* limitations under the License.
*/

import { DocumentNode, graphql, parse, print } from "graphql";
import { DocumentNode, graphql, parse, print, SelectionSetNode } from "graphql";
import pluralize from "pluralize";
import camelCase from "camelcase";
import { Neo4jGraphQL, upperFirst } from "@neo4j/graphql";
Expand All @@ -29,7 +29,7 @@ export interface ModelConstructor {
neoSchema: Neo4jGraphQL;
}

function printSelectionSet(selectionSet: string | DocumentNode): string {
function printSelectionSet(selectionSet: string | DocumentNode | SelectionSetNode): string {
if (typeof selectionSet === "string") {
return print(parse(selectionSet));
}
Expand Down Expand Up @@ -70,7 +70,7 @@ class Model {
}: {
where?: GraphQLWhereArg;
options?: GraphQLOptionsArg;
selectionSet?: string | DocumentNode;
selectionSet?: string | DocumentNode | SelectionSetNode;
args?: any;
context?: any;
rootValue?: any;
Expand Down Expand Up @@ -142,7 +142,7 @@ class Model {
rootValue = null,
}: {
input?: any;
selectionSet?: string | DocumentNode;
selectionSet?: string | DocumentNode | SelectionSetNode;
args?: any;
context?: any;
rootValue?: any;
Expand Down Expand Up @@ -194,7 +194,7 @@ class Model {
connect?: any;
disconnect?: any;
create?: any;
selectionSet?: string | DocumentNode;
selectionSet?: string | DocumentNode | SelectionSetNode;
args?: any;
context?: any;
rootValue?: any;
Expand Down

0 comments on commit f46dedc

Please sign in to comment.