Skip to content

[pull] master from supabase:master #1520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 30, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented Apr 30, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

charislam and others added 5 commits April 29, 2025 15:27
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.
Wrappers docs should not be pulled from the main branch, which contains
unreleased content, but instead from the latest release tag.
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.
* 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.
@pull pull bot added the ⤵️ pull label Apr 30, 2025
@pull pull bot merged commit 4a0e27f into boost-entropy-typescript:master Apr 30, 2025
Copy link

Thanks for contributing to Supabase! ❤️ Our team will review your PR.

A few tips for a smoother review process:

  • If you have a local version of the repo, run pnpm run format to make sure formatting checks pass.
  • Once we've reviewed your PR, please don't trivially merge master (don't click Update branch if there are no merge conflicts to be fixed). This invalidates any pre-merge checks we've run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants