{"id":21663894,"url":"https://github.com/tobkle/create-graphql-server-connections","last_synced_at":"2026-05-07T23:01:38.088Z","repository":{"id":119549404,"uuid":"102842879","full_name":"tobkle/create-graphql-server-connections","owner":"tobkle","description":"Enhance create-graphql-server with Relay Connections for Cursor-based Pagination","archived":false,"fork":false,"pushed_at":"2017-09-10T10:38:39.000Z","size":827,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-01T22:50:42.658Z","etag":null,"topics":["connection","create-graphql-server","cursor","generator","graphql","nodejs","relay","server"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tobkle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-08T09:15:21.000Z","updated_at":"2017-09-09T21:35:28.000Z","dependencies_parsed_at":"2023-06-26T00:07:52.981Z","dependency_job_id":null,"html_url":"https://github.com/tobkle/create-graphql-server-connections","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":0.07692307692307687,"last_synced_commit":"0602322ca65a777b748cf239e313d8934b660344"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tobkle/create-graphql-server-connections","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobkle%2Fcreate-graphql-server-connections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobkle%2Fcreate-graphql-server-connections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobkle%2Fcreate-graphql-server-connections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobkle%2Fcreate-graphql-server-connections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobkle","download_url":"https://codeload.github.com/tobkle/create-graphql-server-connections/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobkle%2Fcreate-graphql-server-connections/sbom","scorecard":{"id":890951,"data":{"date":"2025-08-11","repo":{"name":"github.com/tobkle/create-graphql-server-connections","commit":"0602322ca65a777b748cf239e313d8934b660344"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: npmCommand not pinned by hash: resources/localpublish.sh:25","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"96 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-8462-q7x7-g2x4","Warn: Project is vulnerable to: GHSA-4jwp-vfvf-657p","Warn: Project is vulnerable to: GHSA-v8w9-2789-6hhr","Warn: Project is vulnerable to: GHSA-p84x-5xx8-hff9","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-p28h-cc7q-c4fg","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-4hpf-3wq7-5rpr","Warn: Project is vulnerable to: GHSA-f522-ffg8-j8r6","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q","Warn: Project is vulnerable to: GHSA-8v5f-hp78-jgxq","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-2m96-9w4j-wgv7","Warn: Project is vulnerable to: GHSA-h726-x36v-rx45","Warn: Project is vulnerable to: GHSA-7px7-7xjx-hxm8","Warn: Project is vulnerable to: GHSA-x5pg-88wf-qq4p","Warn: Project is vulnerable to: GHSA-p9wx-2529-fp83","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-f9cm-qmx5-m98h","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-mh5c-679w-hh4r","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-6394-6h9h-cfjg","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-mxhp-79qh-mcx6","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-g7q5-pjjr-gqvp","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-xc7v-wxcw-j472","Warn: Project is vulnerable to: GHSA-662x-fhqg-9p8v","Warn: Project is vulnerable to: GHSA-394c-5j6w-4xmx","Warn: Project is vulnerable to: GHSA-78cj-fxph-m83p","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-332q-7ff2-57h2","Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T11:48:53.754Z","repository_id":119549404,"created_at":"2025-08-24T11:48:53.754Z","updated_at":"2025-08-24T11:48:53.754Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32759448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["connection","create-graphql-server","cursor","generator","graphql","nodejs","relay","server"],"created_at":"2024-11-25T10:29:19.707Z","updated_at":"2026-05-07T23:01:38.070Z","avatar_url":"https://github.com/tobkle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/create-graphql-server-connections.svg)](http://badge.fury.io/js/create-graphql-server-connections) [![Build Status](https://travis-ci.org/tobkle/create-graphql-server-connections.svg?branch=master)](https://travis-ci.org/tobkle/create-graphql-server-connections) [![Coverage Status](https://coveralls.io/repos/github/tobkle/create-graphql-server-connections/badge.svg?branch=master)](https://coveralls.io/github/tobkle/create-graphql-server-connections?branch=master)\n\n# create-graphql-server-connections\n\nBuild Relay like connections for cursor based pagination.\n\nTODO: First prototype. Didn't do thoroughly testing so far.\n\nFor array-like fields, you can generate a connection with forward and backward pagination, using first, last, before, after. The pagination starts after applying e.g. filters and orderBys on the remaining document result set.\n\n[It implements the algorithm of the Relay connection specification.](https://facebook.github.io/relay/graphql/connections.htm#sec-Edges)\n\nIts generator is triggered only, if there is a directive on header level. If the directive appears, all paginated fields will get cursor-based connections.\n```javascript\n@paginate(by: \"cursor\")\n```\n\nIf you want to have the \"simple\" pagination for a type instead, use the following or don't enter the paginate directive.\n```javascript \n@paginate(by: \"simple\")\n```\n\nYou can also combine both, meaning all paginated fields will be added to the schema as \"simple\" paginated fields, but also as a duplicate named as \u003cfield\u003eConnection. The latter one will be added as \"cursor\" based paginated field. Use one of the following alternatives therefore:\n```javascript\n@paginate(by: \"both\")\nor:\n@paginate(by: [\"simple\", \"cursor\"])\n```\n\n## Purpose\nYou build a GraphQL server with the npm package \"create-graphql-server\", which serves as a backend generator to web applications. This \"create-graphql-server\" generates schemas, resolvers and models for an express-js server.\n\nThis package enhances the generator to build additional pagination arguments and required resolvers.\n\nIt provides the following additional arguments:\n\nUse:\n* \"first\" \"after\"\n* \"last\" \"before\"\n\n### Forward Pagination\nForward Pagination returns edges (documents), which are coming after the cursor \u003cafter\u003e (which is a document's createdAt in our case). It returns at most a number of \u003cfirst\u003e edges.\n\nThe arguments:\n* first: takes a non-negative integer\n* after: takes the cursor type\n \n### Backward Pagination \nBackward Pagination returns edges (documents), which are coming before the cursor \u003cbefore\u003e. It returns at most a number of \u003clast\u003e edges.\n\nThe arguments:\n* last: takes a non-negative integer\n* before: takes the cursor type\n\n## Installation\n\n### Adjust schema\nIn create-graphql-server go to \"generate/schema/index\".\n\nAdd the following code. The import at the beginning the rest at the end of the file.\n```javascript\nimport { enhanceSchemaWithConnections } from 'create-graphql-server-connections';  // \u003c=== here\n...\n...\n  const outputSchema = enhanceSchemaWithConnections(outputSchema);   // \u003c=== here\n  return outputSchema;\n}\n```\n\n### Adjust model\nIn create-graphql-server go to \"generate/model/index\".\n\nAdjust the following code.\n```javascript\n...\nimport { templates } from 'create-graphql-server-connections';     // \u003c=== here\n\n...\n\nexport function generateModelAst(inputSchema) {\n  // the last template path, determines the start template: type/default\n  // the last path has the highest priority and may overwrite\n  // partial templates, if they have equal names\n  const templateCode = getCode(MODEL, {\n    inputSchema,\n    templatePaths: [\n      templates.model,                                             // \u003c=== here\n      [modulePath, 'templates', 'model', 'auth'],\n      [__dirname, 'templates'],\n    ]\n  });\n\n...\n }\n```\n\n### Adjust getContext\nIn create-graphql-server go to \"generate/util/getContext.js\"\n```javascript\nimport { getPaginationContext } from 'create-graphql-server-connections';  // \u003c=== here\n...\n\n  // this is the returned data context for the later template processing\n  return {\n    authorize,\n    isUserType,\n    typeName,\n    TypeName,\n    User,\n    userRoles,\n    docRoles,\n    firstUserRole,\n    roleField,\n    singularFields,\n    paginatedFields,\n    ...getPaginationContext(inputSchema)                                   // \u003c=== here\n  };\n}\n...\n\n```\n\n### Adjust type resolvers\nIn create-graphql-server go to \"generate/resolvers/index\".\n\nAdjust the following code.\n```javascript\n...\nimport { templates } from 'create-graphql-server-connections';     // \u003c=== here\n\n...\n\nexport function generateModelAst(inputSchema) {\n  // the last template path, determines the start template: type/default\n  // the last path has the highest priority and may overwrite\n  // partial templates, if they have equal names\n  const templateCode = getCode(MODEL, {\n    inputSchema,\n    templatePaths: [\n      templates.resolvers,                                         // \u003c=== here\n      [modulePath, 'templates', 'model', 'auth'],\n      [__dirname, 'templates'],\n    ]\n  });\n\n...\n\n }\n```\n\n### Adjust default schema\nIn create-graphql-server go to \"skel/schema/index.js\".\n\nAdjust the following code:\n```javascript\n...\nimport path from 'path';\t\t\t\t\t\t\t\t\t\t\t\t// \u003c=== here\nimport { templates } from 'create-graphql-server-connections';          // \u003c=== here\n...\n...\n\ntypeDefs.push(buildRequiredTypes());\n\ntypeDefs.push(requireGraphQL( \t\t\t\t\t\t\t\t\t\t\t// \u003c=== here\n  path.join(...templates.schema, 'common', 'requiredTypes.graphql')\t\t// \u003c=== here\n));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// \u003c=== here\n\nexport default typeDefs;\n\n```\nDo the same again in \"test/output-app/schema/index.js\"\n\n### Adjust resolver templates\nIn create-graphql-server go to \"generate/resolvers/templates/default\"\n\nChange \"default_default\" template, to this:\n```javascript\n/* eslint-disable prettier */\n/* eslint comma-dangle: [2, \"only-multiline\"] */\nconst resolvers = {\n{{\u003e connectionTypes}}                     // \u003c=== here\n  {{TypeName}}: {\n    id({{typeName}}) {\n      return {{typeName}}._id;\n    },\n{{#each singularFields}}\n{{\u003e defaultSingularField }}\n{{/each}}\n{{\u003e connectionPaginatedFields}}          // \u003c=== here\n\n  },\n  Query: {\n    {{typeName}}s(root, args, { {{TypeName}}, me }) {\n      return {{TypeName}}.find(args, me, '{{typeName}}s');\n    },\n\n    {{typeName}}(root, { id }, { {{TypeName}}, me }) {\n      return {{TypeName}}.findOneById(id, me, '{{typeName}}');\n    }\n  },\n\n...\n```\nPlease add these to referenced partial templates \"connectionTypes\" and \"connectionPaginatedFields\" to the resolver.\nThese two partials are coming from this npm module. \n\nIf you have create-graphql-server-authorization installed as well, do the same adjustments with your template \"authorize_default\".\n\n### Adjust model templates\nIn create-graphql-server go to \"generate/model/templates\"\n\nDo the same for all templates:\n* default/default_default.template\n* user/default_user.template\n\nIf you have \"create-graphql-server-authorization\" implemented, do it also for\n* authorize_default.template\n* authorize_user.template\n\nChange \"default/default_default.template\" template. Replace all three lines:\n```javascript\n{{#each paginatedFields }}\n{{\u003e defaultPaginatedField }}\n{{/each}}\n```\n\nby this:\n```javascript\n{{\u003e connectionPaginatedFields}}\n```\n\n### Add default resolver for pageInfo\nIn create-graphql-server go to \"skel/resolvers/index.js\". We have to add it here, as it is valid for all generated types, but we can add it only once.\n\nAdjust the code...\n```javascript\n\n...\nimport { resolvers } from 'create-graphql-server-connections';   // \u003c=== here\nmerge(resolvers, resolvers.pageInfo);                            // \u003c=== here\n\nexport default resolvers;\n```\nDo the same in \"test/output-app/resolvers/index.js\"\n\n### Add paginate to the server context\nIn create-graphql-server go to \"skel/server/index.js\".\n```javascript\n...\nimport { paginate } from 'create-graphql-server-connections';                       // \u003c=== here\n...\n\napp.use('/graphql', (req, res, next) =\u003e {\n  passport.authenticate('jwt', { session: false }, (err, me) =\u003e {\n    req.context = addModelsToContext({ \n      db, pubsub, me, UserCollection, findByIds, log, prepareQueries, paginate     // \u003c=== here\n    });\n    graphqlExpress(() =\u003e {\n...\n...\n\t})\n  })\n})\n```\nDo the same in \"test/output-app/server/index.js\".\n\n### Package.json\nAdd to the \"skel/package.json\" the following entry:\n```javascript\n\"create-graphql-server-connections\": \"^0.0.4\",\n``\n\n### Finally\nIf you are having troubles somewhere, have a look into the running example at:\n[tobkle/create-graphql-server branch: Relay-Pagination](https://github.com/tobkle/create-graphql-server/tree/Relay-Pagination)\n\n## Documentation\n[API Documentation](https://tobkle.github.io/create-graphql-server-connections/)\n\n## Tests\nTODO:\n```bash\nyarn test\n```\n\n## Contributing\nIn lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobkle%2Fcreate-graphql-server-connections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobkle%2Fcreate-graphql-server-connections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobkle%2Fcreate-graphql-server-connections/lists"}