{"id":47942,"library":"graphql-skip-limit","title":"graphql-skip-limit","description":"A library for constructing GraphQL servers with skip/limit pagination instead of Relay's cursor-based pagination. Version 2.3.1 is the latest stable release, with infrequent updates as it's maintained primarily for Gatsby's data layer. It is a port of graphql-relay-js, using similar APIs but with skip/limit arguments. Requires graphql ^14.1.1 as a peer dependency. Its main differentiator is simplicity for offset-based pagination, but it is deprecated in favor of cursor-based approaches.","status":"deprecated","version":"2.3.1","language":"javascript","source_language":"en","source_url":"https://github.com/gatsbyjs/gatsby","tags":["javascript","gatsby","graphql"],"install":[{"cmd":"npm install graphql-skip-limit","lang":"bash","label":"npm"},{"cmd":"yarn add graphql-skip-limit","lang":"bash","label":"yarn"},{"cmd":"pnpm add graphql-skip-limit","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for building GraphQL types and schemas","package":"graphql","optional":false}],"imports":[{"note":"This package is ESM-first; CommonJS require might work with some bundlers but is not guaranteed. Use named import for this function.","wrong":"const { connectionFromArray } = require('graphql-skip-limit')","symbol":"connectionFromArray","correct":"import { connectionFromArray } from 'graphql-skip-limit'"},{"note":"connectionArgs is a named export, not a default export. Always use named import syntax.","wrong":"import connectionArgs from 'graphql-skip-limit'","symbol":"connectionArgs","correct":"import { connectionArgs } from 'graphql-skip-limit'"},{"note":"GraphQLConnectionDef is a TypeScript type and should be imported with `import type` to avoid runtime errors. This is only available in TypeScript environments.","wrong":"import { GraphQLConnectionDef } from 'graphql-skip-limit'","symbol":"GraphQLConnectionDef","correct":"import type { GraphQLConnectionDef } from 'graphql-skip-limit'"}],"quickstart":{"code":"import { connectionArgs, connectionFromArray } from 'graphql-skip-limit';\nimport { GraphQLObjectType, GraphQLSchema, GraphQLList, GraphQLInt } from 'graphql';\n\nconst allFiles = [\n  { id: '1', name: 'file1' },\n  { id: '2', name: 'file2' },\n  { id: '3', name: 'file3' },\n  { id: '4', name: 'file4' },\n  { id: '5', name: 'file5' },\n];\n\nconst FileType = new GraphQLObjectType({\n  name: 'File',\n  fields: {\n    id: { type: GraphQLInt },\n    name: { type: GraphQLString },\n  },\n});\n\nconst ConnectionType = new GraphQLObjectType({\n  name: 'FileConnection',\n  fields: {\n    edges: { type: new GraphQLList(FileEdgeType) },\n    totalCount: { type: GraphQLInt },\n  },\n});\n\nconst queryType = new GraphQLObjectType({\n  name: 'Query',\n  fields: {\n    allFile: {\n      type: ConnectionType,\n      args: connectionArgs,\n      resolve: (_, { skip, limit }) => connectionFromArray(allFiles, { skip, limit }),\n    },\n  },\n});\n\nexport const schema = new GraphQLSchema({ query: queryType });","lang":"typescript","description":"Create a GraphQL schema with skip/limit pagination using connectionFromArray and connectionArgs."},"warnings":[{"fix":"Migrate to graphql-relay and use cursor-based connections.","message":"This package is deprecated. The Gatsby team recommends using cursor-based pagination with graphql-relay instead.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Ensure limit is a positive integer or undefined.","message":"The package does not support limit arguments of 0; that will throw an error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Document that your schema uses skip/limit pagination.","message":"skip and limit arguments are added to the field arguments, but they are not part of the GraphQL spec; clients must be aware of these custom arguments.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use import syntax instead of require(). If you need CommonJS, stick with version 1.x.","message":"In version 2.0.0, the package switched to ES modules and dropped CommonJS support.","severity":"breaking","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'14.1.1':60 '2.3.1':23 'api':53 'approach':85 'argument':57 'base':20,73,84 'construct':8 'cursor':19,83 'cursor-bas':18,82 'data':40 'depend':64 'deprec':78 'differenti':67 'favor':80 'gatsbi':38,87 'graphql':2,9,48,59,88 'graphql-relay-j':47 'graphql-skip-limit':1 'infrequ':30 'instead':14 'javascript':86 'js':50 'latest':26 'layer':41 'librari':6 'limit':4 'main':66 'maintain':35 'offset':72 'offset-bas':71 'pagin':13,21,74 'peer':63 'port':45 'primarili':36 'relay':16,49 'releas':28 'requir':58 'server':10 'similar':52 'simplic':69 'skip':3 'skip/limit':12,56 'stabl':27 'updat':31 'use':51 'version':22","created_at":"2026-06-07T16:54:07.480642+00:00","updated_at":"2026-06-07T16:54:07.480642+00:00","problems":[{"fix":"Run npm install graphql-skip-limit graphql","cause":"The package is not installed or is not in node_modules.","error":"Error: Cannot find module 'graphql-skip-limit'"},{"fix":"Change import to: import { connectionFromArray } from 'graphql-skip-limit'","cause":"Default import used instead of named import.","error":"TypeError: connectionFromArray is not a function"},{"fix":"Add ...connectionArgs to the field's args object.","cause":"The connectionArgs are not spread into the field arguments.","error":"GraphQLError: Unknown argument \"skip\" on field \"allFile\"."},{"fix":"Ensure limit is a positive integer or omit it.","cause":"Limit argument set to 0 or negative.","error":"Error: limit must be a positive number"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/gatsbyjs/gatsby/tree/master/packages/graphql-skip-limit#readme","github":"https://github.com/gatsbyjs/gatsby","docs":null,"changelog":null,"pypi":null,"npm":"graphql-skip-limit","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}