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

Dynamic GraphQL API #63

Closed
wants to merge 12 commits into from
Closed

Conversation

adzialocha
Copy link
Member

@adzialocha adzialocha commented Jan 29, 2022

This will be split into several PRs:

  • Parse GraphQL into abstract query representation
  • Convert abstract query representation into SELECT SQL query
    • Filter by document hash
    • Sort ASC or DESC by any application data field
    • Get relation schema name + hash from application schema
    • JOINS for relation fields
      • Validate maximum depth
  • Validate abstract query with registered Schema
  • Run SQL query and return results in GraphQL response
  • Handle errors correctly
    • Return them nicely in GraphQL API
  • Support introspection

Closes: #64

📋 Checklist

  • Add tests that cover your changes
  • Add this PR to the Unreleased section in CHANGELOG.md
  • Link this PR to any issues it closes
  • New files contain a SPDX license header

@adzialocha adzialocha changed the base branch from main to materialisation-task January 29, 2022 00:04
Comment on lines +386 to +408
fn graphql_to_abstract() {
let query = "{
events_0020c65567ae37efea293e34a9c7d13f8f2bf23dbdc3b5c7b9ab46293111c48fc78b(document: \"0020b177ec1bf26dfb3b7010d473e6d44713b29b765b99c6e60ecbfae742de496543\") {
document
fields {
title
content
some_relation_0020c65567ae37efea293e34a9c7d13f8f2bf23dbdc3b5c7b9ab46293111c48fc78b {
document
fields {
example
url
another_relation_0020c65567ae37efea293e34a9c7d13f8f2bf23dbdc3b5c7b9ab46293111c48fc78b {
fields {
test
}
}
}
}
}
}
}";
assert!(AbstractQuery::new(query).is_ok());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

@adzialocha adzialocha closed this Apr 2, 2022
@adzialocha adzialocha deleted the dynamic-graphql-schema branch June 29, 2022 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants