fxa/packages/fxa-graphql-api
Danny Coates 42a6f8a395
feat(settings): add session verified state to graphql
because the frontend needs to know about the verified state of the session
2020-08-05 16:38:33 -07:00
..
.vscode chore(deps): updated dependencies 2020-06-22 17:11:50 -07:00
src feat(settings): add session verified state to graphql 2020-08-05 16:38:33 -07:00
.dockerignore feat(graphql-api): initial base project 2020-04-22 11:47:46 -07:00
.nsprc feat(graphql-api): initial base project 2020-04-22 11:47:46 -07:00
CHANGELOG.md chore(releases): add missing CHANGELOG files, mod release script to update them 2020-07-29 10:20:20 -04:00
LICENSE feat(graphql-api): initial base project 2020-04-22 11:47:46 -07:00
README.md chore(docs): Add documentation for connecting to the GQL playground 2020-08-03 11:41:42 -05:00
package.json feat(auth-client): replace fxa-js-client with fxa-auth-client 2020-07-21 09:08:35 -07:00
pm2.config.js chore(pm2): Add ISO timestamp to pm2 log lines 2020-06-17 17:01:16 -07:00
tsconfig.json feat(auth-client): replace fxa-js-client with fxa-auth-client 2020-07-21 09:08:35 -07:00

README.md

FXA GraphQL API

This is the GraphQL server for the Firefox Accounts API, its current primary consume is the new settings page.

Connecting to the Playground

The GraphQL playground for this package is available at localhost:8290/graphql, providing a GUI for an up-to-date schema and API docs, as well as a way to test queries and mutations.

The playground requires a sessionToken for authorization from the login response. Verify an account locally, sign out, and with the Network tab open, login. Under the "Response" tab for the account/login POST request, copy the sessionToken.

Add this as a property of a JSON object with an authorization key in the bottom left-hand corner of the GQL playground labeled "HTTP Headers":

{
  "authorization": "d4a62a0f58efb0e9c7d17b579434f2a56cad10503033874002ddd507a503cea5"
}

Hit the "play" button and the schema and docs will populate.

Testing

This package uses Mocha to test its code. By default npm test will test all files ending in .spec.ts under src/test/ and uses ts-node so it can process TypeScript files.

Test specific tests with the following commands:

# Test only src/test/lib/sentry.spec.ts
npx mocha -r ts-node/register src/test/lib/sentry.spec.ts

# Grep for "bearer token"
npx mocha -r ts-node/register src/test/lib/** -g "bearer token"

Refer to Mocha's CLI documentation for more advanced test configuration.

License

MPL-2.0