https://github.com/mozilla-frontend-infra/bugzilla-graphql-gateway
An intermediary gateway between a GraphQL client and the Bugzilla REST API. Currently only supports public `query` operations, not `mutation` or `subscription`.
https://github.com/mozilla-frontend-infra/bugzilla-graphql-gateway
Last synced: 2 months ago
JSON representation
An intermediary gateway between a GraphQL client and the Bugzilla REST API. Currently only supports public `query` operations, not `mutation` or `subscription`.
- Host: GitHub
- URL: https://github.com/mozilla-frontend-infra/bugzilla-graphql-gateway
- Owner: mozilla-frontend-infra
- Created: 2018-03-16T23:14:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-09-26T15:51:31.000Z (3 months ago)
- Last Synced: 2025-09-26T17:41:43.549Z (3 months ago)
- Language: JavaScript
- Size: 311 KB
- Stars: 8
- Watchers: 1
- Forks: 9
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bugzilla GraphQL Gateway
An intermediary gateway between a GraphQL client and the Bugzilla REST API.
Currently only supports public `query` operations, not `mutation` or `subscription`.
## Environment variables
By default this gateway relies on the `PORT` and `BUGZILLA_ENDPOINT`. If not set, these
values default to `3090` and `https://bugzilla.mozilla.org/rest/bug` respectively.
Additionally, `BUGZILLA_API_KEY` may be set to prevent the API from being rate-limited.
To override these values, either set them on the command line or
place a `.env` file in the root of this repo with the following environment variables
inside of it, using your overrides instead of these defaults:
```sh
PORT=3090
BUGZILLA_ENDPOINT="https://bugzilla.mozilla.org/rest/bug"
BUGZILLA_API_KEY=
```
## Launching locally
To start the service up locally, first install dependencies using `yarn`.
Use the command `yarn start` to start the
service, which launches on the `PORT` environment variable.
You should see the following message in the console, for example, using port 3090 by default:
```bash
Bugzilla GraphQL gateway running on port 3090.
Open the interactive GraphQL Playground, schema explorer and docs in your browser at:
http://localhost:3090
```
## Sample Queries
Query a bug by ID, `996038`. Access the bug's summary, status, and resolution:
```graphql
query Bug {
bug(id: 996038) {
summary
status
resolution
}
}
```

---
Query all bugs in the `Taskcluster` product, in the `Tools` component, with the
assignee of `eperelman@mozilla.com` or `helfi92@gmail.com`, specified by query variables.
Access each of matched bugs' ID, summary, status, and resolution. Also limit pages to 10 bugs each,
and get paging information back from the query.
```graphql
query Bugs($search: BugSearch!, $paging: Paging) {
bugs(search: $search, paging: $paging) {
pageInfo {
hasNextPage
nextPage
}
edges {
node {
id
summary
status
resolution
}
}
}
}
```
Variables:
```json
{
"search": {
"components": ["Tools"],
"products": ["Taskcluster"],
"assignedTos": [
"eperelman@mozilla.com",
"helfi92@gmail.com"
]
},
"paging": {
"page": 0,
"pageSize": 10
}
}
```

## Apollo Engine
You can enable tracing and caching to the Apollo Engine service by setting the
`APOLLO_ENGINE_KEY` environment variable.