Conversation
|
/assign |
kerthcet
left a comment
There was a problem hiding this comment.
Generally LGTM.
Thanks @wanyingz-dis
| python-version | ||
| testenv/ | ||
| ptest/ | ||
| .python-version No newline at end of file |
| class GraphQLResolvers: | ||
|
|
||
| @staticmethod | ||
| def get_projects() -> List[Project]: |
There was a problem hiding this comment.
Maybe rename similar function names to def list_xxx()? Easy to tell.
|
|
||
| if __name__ == "__main__": | ||
| print("Hello, AlphaTrion!") | ||
| import uvicorn |
| # root endpoint for testing | ||
| @app.get("/") | ||
| def root(): | ||
| return {"message": "AlphaTrion API running"} |
There was a problem hiding this comment.
Implementation will be in another PR right?
There was a problem hiding this comment.
Thanks @kerthcet for your review and feedback, Yes, implementation will come in the next PR.
This one only sets up the schema & scaffolding.
| @strawberry.type | ||
| class Metric: | ||
| id: strawberry.ID | ||
| trial_id: strawberry.ID |
There was a problem hiding this comment.
I guess trial_id is not needed here because usually we query the metric via trial_id. We can add it back if needed.
|
You can run make format to reproduce the lint error. |
|
We can remove the test_main for now, once we have the api, we can add integration-tests at that time. |
|
/lgtm part of #59 |
Add initial GraphQL API server (schema, types, router, placeholder resolvers)
Summary
This PR introduces the initial GraphQL API layer for the AlphaTrion dashboard.
It provides the minimal end-to-end structure required for the frontend to begin querying data through a unified GraphQL endpoint.
This includes:
/graphql)pyproject.tomlanduv.lock.gitignoreThis PR intentionally focuses on API structure and scaffolding instead of full backend logic.
What This PR Adds
1. GraphQL Schema + Types
ProjectExperimentTrialRunMetric2. Resolver Class
Resolvers currently return placeholder empty lists or
None.This allows:
Database integration (SQLAlchemy -- > Postgres) will come in a later PR.
3. FastAPI Integration
/graphqlendpoint usingGraphQLRouter.4. Dependency Updates
uv.lockusinguv.5. Repository Cleanup
.gitignoreto exclude.venv,.python-version, and dev-only folders.Run the GraphQL API server:
uv run uvicorn alphatrion.main:app