Skip to content

Commit

Permalink
graphql-syntax: add comments explaining FloatNode
Browse files Browse the repository at this point in the history
Summary: It was a bit confusing why we had certain fields in FloatNode. This change adds some comments to help future readers understand.

Reviewed By: captbaritone

Differential Revision: D48117872

fbshipit-source-id: ea7bad15b47761807887c77484ab01f40102f422
  • Loading branch information
Alex Danoff authored and facebook-github-bot committed Aug 7, 2023
1 parent b3e281b commit beb0e92
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/crates/graphql-syntax/src/node/constant_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ impl fmt::Display for IntNode {
#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct FloatNode {
pub token: Token,
/// NOTE: we can't just store an f64 here because it doesn't implement Hash, Eq, Ord
pub value: FloatValue,
/// Preserve a value, as it was represented in the source
/// TODO: We may remove this, as we migrate from JS
/// NOTE: this is needed for pretty-printing the AST to ensure we don't change what was in the source
pub source_value: StringKey,
}

Expand Down

0 comments on commit beb0e92

Please sign in to comment.