A PageInfoType according to relay for apollo server.
First install the package
npm i @tituskirch/pageinfotype
Then import the type definition.
import pageinfotype from '@tituskirch/pageinfotype'
Now you can merge pageinfotype.typeDef
with your other TypeDefs and pass it to the ApolloServer. In your TypeDefs you can now access the type PageInfo
without any problems. Remember to write a resolver for PageInfo.
type PageInfo {
hasNextPage: Boolean
hasPreviousPage: Boolean
startCursor: String!
endCursor: String!
}
Command | Aliases | Description |
---|---|---|
npm run build:production |
npm run build |
Builds the app with the production settings. |
npm run build:dev |
npm run build:development |
Builds the app with the development settings. |
npm run start |
- | Starts the app with the .env file. |
npm run start:watch |
- | Starts the app with the .env file and nodemon. |
npm run eslint |
- | Run ESLint to check the code style. |
👤 Titus Kirch
- Website: https://tkirch.dev
- Twitter: @TitusKirch
- Github: @TitusKirch
- LinkedIn: @TitusKirch
Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.
Give a ⭐️ if this project helped you!
Copyright © 2020 Titus Kirch.
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator