Skip to content

Commit

Permalink
Merge pull request #365 from darrellwarde/bugfix/ogm-selection-set-node
Browse files Browse the repository at this point in the history
Allow OGM selectionSet to be SelectionSetNode
  • Loading branch information
darrellwarde authored Jul 29, 2021
2 parents b47e985 + f46dedc commit b8b4b3c
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 b8b4b3c

Please sign in to comment.