Skip to content

Commit 6a3bc83

Browse files
authored
Merge pull request #82 from wednesday-solutions/fix/graphql-relay
Fix/graphql relay
2 parents 4b8ac33 + 20170d6 commit 6a3bc83

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@ Relay support has been added by following [this](https://github.com/mickhansen/g
6565

6666
## Setup
6767

68+
### Setting up database (postgres)
69+
70+
- Requirement [postgresql](https://www.postgresql.org/)
71+
72+
Steps to set up database with `username` and `role` using terminal
73+
74+
- Enter postgres terminal `psql postgres`
75+
- Create new database `CREATE DATABASE reporting_dashboard_dev;`
76+
- Create a new role with password `CREATE ROLE reporting_dashboard_role WITH LOGIN PASSWORD 'reportingdashboard123';`
77+
6878
### Setup and run locally using
6979

7080
```

server/gql/queries.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ export const addQueries = () => {
4545
args: {
4646
...DB_TABLES[table].list?.args,
4747
...defaultListArgs(DB_TABLES[table].model),
48-
limit: { type: GraphQLNonNull(GraphQLInt) },
49-
offset: { type: GraphQLNonNull(GraphQLInt) }
48+
limit: { type: GraphQLInt, description: 'Use with offset to get paginated results with total' },
49+
offset: { type: GraphQLInt, description: 'Use with limit to get paginated results with total' },
50+
before: { type: GraphQLInt, description: 'Use with grapql-relay compliant queries' },
51+
after: { type: GraphQLInt, description: 'Use with grapql-relay compliant queries' },
52+
first: { type: GraphQLInt, description: 'Use with grapql-relay compliant queries' },
53+
last: { type: GraphQLInt, description: 'Use with grapql-relay compliant queries' }
5054
}
5155
};
5256
});

0 commit comments

Comments
 (0)