fxa/packages/fxa-graphql-api
Barry Chen bf0c4faeb0
Merge pull request #15121 from mozilla/fxa-5948-esbuild
chore(deps): upgrade esbuild to 0.17.15
2023-04-07 07:13:03 -07:00
..
.vscode chore(multiple): update mocha wherever used 2022-06-28 09:03:42 -07:00
src task(settings): Remove .only from PairingSupplicantRelier test 2023-03-28 17:12:18 -07:00
test feat(api): Add gql resolvers for security events 2023-01-19 00:11:52 -05:00
.nsprc feat(graphql-api): initial base project 2020-04-22 11:47:46 -07:00
CHANGELOG.md Merge pull request #13572 from mozilla/FXA-5496-stop-generating-changelogs-in-our-release-script 2022-07-11 16:20:36 -07:00
LICENSE feat(graphql-api): initial base project 2020-04-22 11:47:46 -07:00
README.md fix(graphql): Fix graphql playground 2022-05-11 15:00:13 -04:00
nest-cli.json feat(graphql-api): convert to NestJS 2020-11-30 15:33:24 -08:00
package.json Merge pull request #15121 from mozilla/fxa-5948-esbuild 2023-04-07 07:13:03 -07:00
pm2.config.js chore(deps): upgrade to node.js 18 2023-03-20 13:28:10 -05:00
tsconfig.build.json feat(graphql-api): convert to NestJS 2020-11-30 15:33:24 -08:00
tsconfig.json task(CI): build, unit test, and integration test jobs 2023-01-10 12:52:01 -08: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": "Bearer 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 esbuild-register so it can process TypeScript files.

Test specific tests with the following commands:

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

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

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

License

MPL-2.0