-
Notifications
You must be signed in to change notification settings - Fork 0
GraphQL Gateway for Milo APIServer #1
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: main
Are you sure you want to change the base?
Conversation
- Removed the build stage from the Dockerfile, directly copying the generated supergraph.graphql file. - Updated .dockerignore and .gitignore to exclude supergraph.graphql from version control.
…ication, and ResourceManager
…M, Notification, and ResourceManager" This reverts commit 6d44dac.
…rignore and .gitignore to include dist directory
…rfile for runtime configuration
…uthentication, and local testing enhancements
…ing from K8s OpenAPI endpoint
|
@zachsmith1 Thank you for all of your feedback during the designing process |
…with increased default interval
|
We need an |
drewr
left a comment
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.
Won't officially approve without a closer look, but this is great work @JoseSzycho!
|
@JoseSzycho In the ticket, the listed deliverables include GraphQL schema additions and resolver implementations. However, I don’t see a sample resolver implementation here. For example, if we have a query like: listNotificationMiloapisComV1alpha1NamespacedContactGroupMembership(
namespace: ""
) {
items {
spec {
contactRef {
name
namespace
}
}
}
}How do we retrieve the actual contact details (e.g., familyName, givenName, etc.) from this reference? I just want to make sure I’m not missing something. But great work! |
|
@drewr Thanks! Already fixed the code adding missing |
|
@ggaghan430 thanks for the feedback! We should have updated the issue earlier. We decided to change the implementation and make each GraphQL consumer responsible for implementing its own resolvers and type generation. In this PR, you can see how to auto-generate the types and queries consumed from the GraphQL gateway: Here, we define the custom queries we need: It is important to have the process.env.GRAPHQL_URL environment variable set, as the codegen process performs schema introspection against the GraphQL gateway. This is beneficial because if the API is updated and your custom queries become outdated, the generation step will fail with an error. Once the code has been generated, you can implement the requests. Here is an example: This is the approach I came up with. I do not have extensive front-end experience, so please feel free to suggest improvements or propose changes to the current GraphQL implementation. |
|
@JoseSzycho Sorry if my question wasn’t very clear earlier :D. |
|
@gaghan430 At the moment, we are not supporting schema additions or extensions like the ones described in the GraphQL Mesh documentation. The current scope is limited to providing an auto-generated GraphQL layer based on the existing OpenAPI specifications exposed by Milo. We could create a issue for tackling this in the future |
Summary
Introduces a GraphQL Gateway that dynamically exposes Milo APIServer REST/OpenAPI services as a unified GraphQL API using Hive Gateway.
What's Included
Core Gateway
/openapi/v3Endpoints
/graphql/healthcheck/readiness/{apiGroup}/{version}/{kind}s/{name}/graphqlKubernetes Deployment
Developer Experience
scripts/local-test.sh) with automatic cert generationArchitecture
Configuration
KUBECONFIGPORT4000POLLING_INTERVAL120000LOGGINGinfoTesting
# Local testing (requires kubectl access to staging) ./scripts/local-test.shStatus
Checklist
Closes datum-cloud/milo#440