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

provide means to extend ApolloDiagnostic #606

Closed
lrlna opened this issue Jul 27, 2023 · 4 comments
Closed

provide means to extend ApolloDiagnostic #606

lrlna opened this issue Jul 27, 2023 · 4 comments
Assignees
Labels
apollo-compiler issues/PRs pertaining to semantic analysis & validation

Comments

@lrlna
Copy link
Member

lrlna commented Jul 27, 2023

For those building on top of apollo-compiler, it'd be useful to be able to create additional ApolloDiagnostic on top of the existing graphql validation diagnostics. This allows to have a unified way of providing validation + extenral graphql diagnostics

@goto-bus-stop
Copy link
Member

Something I thought about briefly was that maybe DiagnosticData could be a trait instead of an enum, so users would be able to add their own implementations. Then ApolloDiagnostic would contain a Box<dyn DiagnosticData>. Ifff we can do that without imposing too much implementation burden on users.

@lrlna
Copy link
Member Author

lrlna commented Jul 27, 2023

yea trait will quite possibly work. we'll just want to provide docs and a couple of examples

@goto-bus-stop goto-bus-stop self-assigned this Aug 17, 2023
@goto-bus-stop goto-bus-stop added the apollo-compiler issues/PRs pertaining to semantic analysis & validation label Aug 17, 2023
@goto-bus-stop
Copy link
Member

I think the plan is gonna be to have a flexible diagnostic type in apollo-rs, that builds on ariadne's, that you can use to add messages/labels and that provides to_json() and get_line_column() and printing. Errors reported by apollo-rs would be convertible to this error type. Federation and other users could implement their own error types for their own use cases and also implement conversion to apollo-rs's generic diagnostic type for printing or use in JSON responses.

@lrlna
Copy link
Member Author

lrlna commented Feb 12, 2024

@goto-bus-stop i feel like we've done a work for this already. shall we close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apollo-compiler issues/PRs pertaining to semantic analysis & validation
Projects
None yet
Development

No branches or pull requests

2 participants