Last active
July 4, 2021 19:27
-
-
Save litewarp/913c1f77581f2ed7e75d7c489b79488c to your computer and use it in GitHub Desktop.
Revisions
-
litewarp revised this gist
Jul 3, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { typeDefs } from './typeDefs' // see https://www.graphql-tools.com/docs/schema-wrapping#renaming const renamingFn = (typeName: string, fieldName: string): string => { if (fieldName === 'skip') { return 'offset' } return inputFieldName -
litewarp revised this gist
Jul 3, 2021 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,5 @@ // temporary fix for https://github.com/neo4j/graphql/issues/292 import { wrapSchema, RenameInputObjectFields } from '@graphql-tools/wrap' import { Neo4jGraphQL } from '@neo4j/graphql' import { typeDefs } from './typeDefs' -
litewarp revised this gist
Jul 3, 2021 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ // temporary fix for https://github.com/neo4j/graphql/issues/292 import { gql } from 'apollo-server' import { wrapSchema, RenameInputObjectFields } from '@graphql-tools/wrap' import { Neo4jGraphQL } from '@neo4j/graphql' -
litewarp revised this gist
Jul 3, 2021 . 2 changed files with 20 additions and 18 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,23 @@ import { gql } from 'apollo-server' import { wrapSchema, RenameInputObjectFields } from '@graphql-tools/wrap' import { Neo4jGraphQL } from '@neo4j/graphql' import { typeDefs } from './typeDefs' // renames all InputObjectFields matching 'skip' // see https://www.graphql-tools.com/docs/schema-wrapping#renaming const renamingFn = (typeName: string, fieldName: string): string => { if (inputFieldName === 'skip') { return 'offset' } return inputFieldName } const neoSchema = new Neo4jGraphQL({ typeDefs }) export const schema = wrapSchema({ schema: neoSchema.schema, transforms: [new RenameInputObjectFields(renamingFn)] }) -
litewarp revised this gist
Jul 2, 2021 . 2 changed files with 21 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ export const schemaTransformer = (typeName: string, fieldName: string, fieldConfig: GraphQLFieldConfig<any, any>) => { if (fieldConfig.args?.skip) { const { skip, ...rest } = fieldConfig.args return { ...fieldConfig, args: { ...rest, offset: skip }} } return fieldConfig } export const This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,11 @@ import { wrapSchema, TransformObjectFields } from '@graphql-tools/wrap' import { schema } from './schema' const sche const objectFieldTransformer = new TransformObjectFields() const wrappedSchema = wrapSchema({ schema: schema, transforms: [] }) -
litewarp created this gist
Jul 2, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ s