-
Notifications
You must be signed in to change notification settings - Fork 12
feat: implement GraphQL interface to the middleware DB #2162
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
base: master
Are you sure you want to change the base?
Conversation
| # Ensure consistent node name for tests to match persisted DB owner (avoids :wrong_db_owner_node) | ||
| config :kernel, :distributed, [:'aeternity@localhost'] | ||
|
|
||
| # Do not start embedded node services for GraphQL/data correctness tests to avoid DB owner mismatch | ||
| # Use full node services in tests; ensure you invoke tests with: | ||
| # elixir --name aeternity@localhost -S mix test | ||
| config :ae_mdw, :start_node_services, true | ||
| config :ae_mdw, :sync, true | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed
| --- | ||
| ## Security Considerations | ||
| - Depth & complexity limits are not yet enforced (add them before exposing publicly). | ||
| - Rate limiting is inherited from existing stack (none specific to GraphQL yet). | ||
| - User input is limited to IDs now; later additions must validate pagination cursors and filters. | ||
|
|
||
| --- | ||
| ## Contributing | ||
| Open a PR adding new fields and include: | ||
| - Schema changes | ||
| - Resolver(s) | ||
| - Unit tests (success + failure) | ||
| - Brief addition to this doc (Roadmap or new section) | ||
|
|
||
| --- | ||
| ## FAQ | ||
| **Why Absinthe instead of generating GraphQL from REST automatically?** | ||
| Absinthe offers strong flexibility, custom middleware, and Elixir-native patterns for batching and instrumentation. | ||
|
|
||
| **Will REST be deprecated?** | ||
| Not in the short term. GraphQL is additive and will target aggregate and selective data retrieval patterns first. | ||
|
|
||
| **How do I enable GraphiQL in prod for debugging?** | ||
| You should not. If absolutely necessary, guard it behind an env flag and temporary branch only. | ||
|
|
||
| --- | ||
| ## Support / Contact | ||
| File an issue in the repository with the `graphql` label for feature requests or bugs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
| import_types(AeMdwWeb.GraphQL.Schema.Helpers.CustomTypes) | ||
|
|
||
| import_types(AeMdwWeb.GraphQL.Schema.Types.AccountTypes) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Types.BlockTypes) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Types.ContractTypes) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Types.NameTypes) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Types.StatsTypes) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Types.StatusTypes) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Types.TransactionTypes) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Types.ChannelTypes) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Types.Aex9Types) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Types.Aex141Types) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Types.OracleTypes) | ||
|
|
||
| import_types(AeMdwWeb.GraphQL.Schema.Queries.AccountQueries) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Queries.BlockQueries) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Queries.ContractQueries) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Queries.NameQueries) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Queries.StatsQueries) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Queries.StatusQueries) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Queries.TransactionQueries) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Queries.ChannelQueries) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Queries.Aex9Queries) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Queries.Aex141Queries) | ||
| import_types(AeMdwWeb.GraphQL.Schema.Queries.OracleQueries) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe allow import_types to take a list as well?
import_types([
AeMdwWeb.GraphQL.Schema.Types.AccountTypes,
AeMdwWeb.GraphQL.Schema.Types.BlockTypes
])Or maybe even multi-arg if possible
No description provided.