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

Add minimal documentation to in ir in trustfall_core #139

Merged
merged 6 commits into from
Feb 10, 2023

Conversation

ginger51011
Copy link
Contributor

Again from #136. These are just minimal docs, to help with understanding trustfall_core/src/ir/

@ginger51011 ginger51011 changed the title Add minimal documentation to in Add minimal documentation to in ir in trustfall_core Feb 10, 2023
@ginger51011
Copy link
Contributor Author

rustfmt fail was on me, my bad

Copy link
Owner

@obi1kenobi obi1kenobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks really good -- thanks for putting it together! Just a few polishing suggestions here and there. Let me know what you think?

@@ -49,8 +54,12 @@ pub struct EdgeParameters(
#[serde(default, skip_serializing_if = "BTreeMap::is_empty")] pub BTreeMap<Arc<str>, FieldValue>,
);

/// IR of components of a query, containing information about the vertex ID
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it's worth trying to stick to always saying Vid throughout the docs, even linking to it as needed? It's a core concept and will keep coming up all over the place in the IR, so I'm worried that mixing between vertex ID and Vid may be more confusing than just sticking to the unambiguous term that the reader has to learn.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be worth linking it every time (so it's always easy to find the definition), but yes it should be the same. I'll replace them!

@@ -26,17 +27,21 @@ lazy_static! {
pub(crate) static ref TYPENAME_META_FIELD_ARC: Arc<str> = Arc::from(TYPENAME_META_FIELD);
}

/// Vertex ID
#[doc(alias("vertex", "node"))]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! 💯

trustfall_core/src/ir/mod.rs Outdated Show resolved Hide resolved
trustfall_core/src/ir/mod.rs Outdated Show resolved Hide resolved
trustfall_core/src/ir/mod.rs Outdated Show resolved Hide resolved
trustfall_core/src/ir/mod.rs Outdated Show resolved Hide resolved
trustfall_core/src/ir/mod.rs Outdated Show resolved Hide resolved
trustfall_core/src/ir/value.rs Outdated Show resolved Hide resolved
trustfall_core/src/ir/value.rs Outdated Show resolved Hide resolved
use async_graphql_value::{ConstValue, Number, Value};
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

/// Values of fields in GraphQL types.
///
/// For version that is serialized as an untagged enum, see [TransparentValue].
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!

ginger51011 and others added 3 commits February 10, 2023 17:38
Better IRQueryComponent docs

Co-authored-by: Predrag Gruevski <[email protected]>
Co-authored-by: Predrag Gruevski <[email protected]>
@ginger51011
Copy link
Contributor Author

Thank you for taking the time to review!

@@ -611,7 +611,7 @@ fn compute_fold<'query, DataToken: Clone + Debug + 'query>(
///
/// A small subtlety is important here: it's possible that the tagged value is *local* to
/// the scope being filtered. In that case, the context *will not* yet have a token associated
/// with the vertex ID of the tag's ContextField. However, in such cases, the tagged value
/// with the [Vid] of the tag's ContextField. However, in such cases, the tagged value
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't have to be in this PR, just wondering: can we link ContextField here too?

trustfall_core/src/ir/mod.rs Outdated Show resolved Hide resolved
@obi1kenobi obi1kenobi enabled auto-merge (squash) February 10, 2023 18:48
@obi1kenobi
Copy link
Owner

Thanks for all the awesome contributions, they are making a huge difference 🚀

@obi1kenobi obi1kenobi merged commit d2c1e1c into obi1kenobi:main Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants