This is a collection of tools to share information between the front end applications and the portal via graphql.
Prerequisites for install
Simply run:
yarn install
We use GraphQL for all the data communication between the applications and the backend. Right now there is a limited set of things we expose but that can grow as needed. For now if we want to expose a query or mutation we simply add a document
in src/sdk/documents/
then run the generate command:
yarn generate
Fix any errors and commit your changes
NOTE: By default, this will use the schema that is currently deployed to production (https://cloud.stardog.com/api/graphql). If you need to generate from a schema that isn't in production yet, temporarily modify codegen.yml
to point it at an updated schema url.
First you need to get a GraphQL-Client
object and configure it for the correct url then use that client in the getSDK
call:
import { GraphQLClient } from 'graphql-request';
import { getSdk } from '.';
const defaultEndpoint = 'https://cloud.stardog.com/api/graphql';
async function main() {
const client = new GraphQLClient(defaultEndpoint);
const sdk = getSdk(client);
const { listConnections } = await sdk.listConnections();
const { profile } = await sdk.profile();
console.log(`GraphQL Connections:`, listConnections);
console.log(`GraphQL Profile:`, profile);
}
main();
You can test this out locally with yarn test
:
⚡ yarn test
yarn run v1.22.10
$ ts-node ./example.ts
GraphQL Connections: []
GraphQL Profile: {
id: null,
username: '',
email: null,
first_name: null,
last_name: null,
company: null,
use_case: null,
is_authenticated: false,
is_superuser: false
}
✨ Done in 2.34s.
The overall process of releasing should go as follows:
- Create a branch from
main
namedrelease/x.x.x
(wherex.x.x
is the version). - Update the yarn version by running
yarn version --new-version x.x.x
. - Push everything to GitHub using
git push --set-upstream origin release/x.x.x
. - Create a PR with the intention to merge
release/x.x.x
intomain
. - If status checks and approvals are satisfied, merge
release/x.x.x
intomain
. - On the Github page for the repo, click on "Releases" on the top, then "Draft a new release".
- Create a new release with a new tag
vx.x.x
and corresponding title. - Click 'Auto-generate release notes' and check the release notes.
- If everything seems fine, publish the release!