Commit Graph

12 Commits

Author SHA1 Message Date
Charis
c740f5ade0 feat(docs): content api allow get requests for caching (#41443)
Content API requests were all accepted via POST (as detailed in the
GraphQL spec) and not amenable to caching.

Now, requests are also accepted via GET (as optionally allowed for query
requests only), and cached.

Also sent the request method to Logflare so we can track the ratio of
GET/POST requests.
2025-12-17 11:46:02 -05:00
Charis
0c0be801ae chore(docs): add logflare logging (#37310) 2025-07-31 15:10:37 -04:00
Charis
d122f289df feat(api gateway logs): add error code explanation (#36315)
Add the ability to look up error code explanation in API Gateway logs.
Also a bunch of GraphQL-related utilities and generated types for
calling the Content API.
2025-06-24 13:18:12 -04:00
Charis
0c04c17bdf fix(docs): sentry errors do not get sent from vercel edge (#36377)
Sentry errors captured on routes run on Edge are not getting properly
sent. This is apparently a known issue where Vercel closes the process
before Sentry can flush, so the exceptions need to be manually flushed:

https://github.com/getsentry/sentry-javascript/issues/9626
2025-06-17 12:49:09 -04:00
Charis
b95c759f25 fix(content api): restrict vercel edge function regions (#36405) 2025-06-16 09:19:38 -04:00
Charis
b5921d10cf chore(content api): reduce max depth (#35530)
Reduce max depth for validation from 9 to 5 because we foresee no
legitimate queries that will require anything so deep.
2025-05-20 19:52:32 -04:00
Charis
ffceb79fd6 chore(docs): add sentry monitoring (#35529) 2025-05-20 22:57:34 +00:00
Charis
ac04e0ddfc test(content api): add prod smoke tests for searchDocs (#35528) 2025-05-20 11:43:14 -04:00
Charis
9e8107c070 fix (content api): local dev introspection (#35279)
* feat (content api): add top-level schema query

Adds a top-level schema query that returns the stringified GraphQL
schema for this endpoint. Useful for LLMs to access the stringified
schema for prompting and tool calls.

Query shape:

```
query Search {
  schema
}
```

Query response:

```
{
  "data": {
    "schema": "schema {\n  query: RootQueryType\n}\n\ntype RootQueryType
{\n  \"\"\"Get the GraphQL schema for this endpoint\"\"\"\n  schema:
String\n}"
  }
}
```

Towards DOCS-214

* test (content api): add schema snapshot

Add schema snapshot test to prevent unintentional changes to public API
for this endpoint

* fixup! feat (content api): add top-level schema query

* fix (content api): local dev introspection

The validation rules that are used for security in production are
preventing GraphiQL from introspecting the schema in dev. Since this DX
feature is incredibly useful, I'm turning off the complexity and depth
validations for dev GraphiQL only. Local curls, etc., will still have
production-standard validation so it can be tested locally.
2025-04-29 16:00:34 -04:00
Charis
ca1cd24a07 fix (content api): return graphql-spec compliant error (#35202)
GraphQL errors were occasionally returned as normal HTTP status code
errors, switched to using only GraphQL-spec compliant errors for the
/docs/api/graphql endpoint.
2025-04-29 15:51:07 -04:00
Charis
e41d90926b feat (content api): graphql validation (#35191)
Continue building out the docs/api/graphql endpoint by adding more
validation:

-A query depth limiter
- A query complexity limiter

Also added dummy (empty) root resolver and schema, plus a dev-only
GraphiQL page for better DX.

Endpoint should still return a 404 for now as there is no resolver.
2025-04-29 15:27:21 -04:00
Charis
a0f5c798df feat(content api): add dummy api/graphql route (#35141)
The first PR in a series to build out the Content API. Adds a dummy
GraphQL route with some tests: for now all this does is validate the
request body and return a 404.
2025-04-29 13:02:36 -04:00