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

Make some compiler types serde-serializable #735

Closed
goto-bus-stop opened this issue Nov 10, 2023 · 2 comments · Fixed by #760
Closed

Make some compiler types serde-serializable #735

goto-bus-stop opened this issue Nov 10, 2023 · 2 comments · Fixed by #760
Assignees
Labels
apollo-compiler issues/PRs pertaining to semantic analysis & validation

Comments

@goto-bus-stop
Copy link
Member

goto-bus-stop commented Nov 10, 2023

Especially for checked Name it would be great if you could use it in a serde (de)serializable structure and get the name value checked during deserialization.

Const values could maybe be deserializable as well, see also #717 (for non-const values, we'd need a way to pass in variable values, so supporting serde would probably not be possible)

Other types?

@goto-bus-stop goto-bus-stop added the apollo-compiler issues/PRs pertaining to semantic analysis & validation label Nov 10, 2023
@SimonSapin
Copy link
Contributor

I don’t think there’s a problem with non-const AST values. Value::Variable contains the name of the referenced variable, we can (de)serialize that.

(PR upcoming doing that)

@goto-bus-stop
Copy link
Member Author

Ah yes. I think what I meant was actually unrelated to this issue. It was about deriving Deserialize for custom structs and using that with a custom deserializer to parse argument Values into Rust types, which would need to handle variables, but that's doesn't need to be a problem (eg. the api could be let s: MyStruct = apollo_rs::serde::from_arguments(&arguments, &variables))

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

Successfully merging a pull request may close this issue.

2 participants