Skip to content

Commit

Permalink
chore: #96 add api version to apollo server (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
zlatanpham authored Jan 31, 2020
1 parent 7a35726 commit 0c73e88
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/graphql-server/src/constants/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const API_VERSION = '2020-01-31'
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CreateContactIdentityCheckArgs } from './contact-identity-check'
import logger from '../../logger'
import { ServerContext } from '../../app'
import errors from '../../errors'
import { API_VERSION } from '../../constants/api'

export const REAPIT_API_BASE_URL = 'https://dev.platform.reapit.net'

Expand All @@ -18,6 +19,7 @@ export const callCreateIdentityCheckAPI = async (args: CreateContactIdentityChec
const headers = {
Authorization: context.authorization,
'Content-Type': 'application/json',
'api-version': API_VERSION,
}
const createResponse = await fetcher({
url: `${URLS.contacts}/${args.contactId}${URLS.identityChecks}`,
Expand Down
3 changes: 3 additions & 0 deletions packages/graphql-server/src/resolvers/contact/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import logger from '../../logger'
import { ServerContext } from '../../app'
import { GetContactByIdArgs, CreateContactArgs, GetContactsArgs } from './contact'
import errors from '../../errors'
import { API_VERSION } from '@/constants/api'

export const REAPIT_API_BASE_URL = 'https://dev.platform.reapit.net'
export const CONTACTS_PER_PAGE = 10
Expand All @@ -22,6 +23,7 @@ export const callGetContactByIdAPI = async (args: GetContactByIdArgs, context: S
headers: {
Authorization: context.authorization,
'Content-Type': 'application/json',
'api-version': API_VERSION,
},
})
return getResponse
Expand All @@ -42,6 +44,7 @@ export const callGetContactsAPI = async (args: GetContactsArgs, context: ServerC
headers: {
Authorization: context.authorization,
'Content-Type': 'application/json',
'api-version': API_VERSION,
},
})
return response
Expand Down

0 comments on commit 0c73e88

Please sign in to comment.