Unofficial GraphQL layer for Up bank API
Built using:
- Accounts -
list
,get
- Ping -
get
- Tags -
list
,add to transaction
,remove from transaction
- Transactions -
list
,get
,list by account
- Webhooks -
list
,get
,create
,delete
,ping
,list logs
View the GitHub project for this repo to track real time progress of functionality.
- Install dependencies
yarn install
- Start the server
yarn start
The local dev server will now start on http://localhost:3000
Access and use the GraphQL playground after starting your server at http://localhost:3000/graphql
To test and verify successful connection you can query the version of the GraphQL server:
Query:
query {
version
}
Response:
{
"data": {
"version": "local"
}
}
To access the UP API An Authorization
HTTP header is required.
This GraphQL servers forwards across any supplied Authorization
to UP.
To get your very own personal access token for UP, visit their getting started page.
For all secure operations (every query/mutation other than version).
You are required to ad the auth token. Inside of the Playground you can add an Authorization
HTTP header under the HTTP HEADER
tab, and add your unique token.
{
"Authorization": "Bearer up:yeah:<token>"
}
Once authorised, you may run a secure operation such as the ping query to test full end-to-end.
Query:
query {
ping {
meta {
id
statusEmoji
}
}
}
Response:
{
"data": {
"ping": {
"meta": {
"id": "<id>",
"statusEmoji": "⚡️"
}
}
}
}
Coming soon™
To run and verify tslint, you can run
yarn lint
The schema for this GraphQL server is automatically generated by the type definitions for the queries and mutations.
These are auto-generated using GraphQL code generator at build. You can manually trigger it by running:
yarn codegen
This will refresh the schema src/modules/schema.d.ts
.
To add a new module (resource) to up-graph:
- Create new folder within
src/modules
- Build out the type definitions for the resource, query and mutations by creating a
type-defs.ts
file. - Run
yarn codegen
to generate the schema from these types - Create your resolvers if required
- Create a
index.ts
within the modules, wiring up the data source, types and resolvers - Add the module to
src/modules/index.ts