Skip to content

Commit

Permalink
Merge pull request #8 from blopez2010/fix-missing-limit-offset-error
Browse files Browse the repository at this point in the history
Fixing missing limit/offset error.
  • Loading branch information
blopez2010 authored Oct 5, 2019
2 parents 4880f69 + 4b56858 commit 5901673
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions src/queries/people.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ const { paginate } = require('./extensions');

module.exports = {
allPeoplePaginated: async (parent, { name, offset, limit }) => {
if (!offset || !limit) {
throw new Error('Missing offset and/or limit fields');
}

const where = name ? {
name: {
[Op.like]: `%${name.trim()}%`
Expand Down
2 changes: 1 addition & 1 deletion src/schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type Query {
allEvents: [Event!]!
getEventByYear(year: String!): Event
allPeople: [People!]!
allPeoplePaginated(name: String, offset: Int, limit: Int): PeoplePaginationResultPayload!
allPeoplePaginated(name: String, offset: Int!, limit: Int!): PeoplePaginationResultPayload!
findPeopleByName(name: String!): [People!]!
allItems: [Item!]!
getItemsByEvent(year: Int!): [Item!]
Expand Down

0 comments on commit 5901673

Please sign in to comment.