Skip to content
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

feat(graphql): output translated DQL query when the graphql debug superflag is set #9280

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

matthewmcneely
Copy link
Member

@matthewmcneely matthewmcneely commented Jan 17, 2025

Description

This change adds the translated DQL query to the GraphQL's extension attribute set when the GraphQL debug superflag is set to true.

In Dgraph, GraphQL queries are translated to DQL before entering the query system. This change allows for an inspection of what the translator is doing behind the scenes.

Potential Use Cases:

  • learning DQL
  • aiding few shot prompting in LMs
  • use in Dgraph "dashboards" or other helper apps

Note: this is for queries (reads) only. Mutations in DQL are pretty straightforward, but support for them could be added in the future.

image

Checklist

  • Code compiles correctly and linting passes locally
  • For all code changes, an entry added to the CHANGELOG.md file describing and linking to
    this PR
  • Tests added for new functionality, or regression tests for bug fixes added as applicable
  • Docs PR

@matthewmcneely matthewmcneely requested a review from a team as a code owner January 17, 2025 20:52
@github-actions github-actions bot added area/testing Testing related issues area/graphql Issues related to GraphQL support on Dgraph. area/core internal mechanisms go Pull requests that update Go code labels Jan 17, 2025
@matthewmcneely matthewmcneely changed the title feature(graphql): output translated DQL query when the graphql debug superflag is set feat(graphql): output translated DQL query when the graphql debug superflag is set Jan 17, 2025
@matthewmcneely matthewmcneely added area/dql-graphql-interop DQL interoperability with GraphQL and removed area/testing Testing related issues area/core internal mechanisms labels Jan 17, 2025
Copy link

trunk-io bot commented Jan 17, 2025

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@matthewmcneely matthewmcneely force-pushed the matthewmcneely/output-translated-dqlquery-when-in-debug-mode branch from 2bdc510 to d31b798 Compare January 22, 2025 19:16
@github-actions github-actions bot added area/testing Testing related issues area/documentation Documentation related issues. area/core internal mechanisms labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core internal mechanisms area/documentation Documentation related issues. area/dql-graphql-interop DQL interoperability with GraphQL area/graphql Issues related to GraphQL support on Dgraph. area/testing Testing related issues go Pull requests that update Go code
Development

Successfully merging this pull request may close these issues.

1 participant