Skip to content

Commit 61417ed

Browse files
committed
chore: update documentation of DynType
1 parent d685014 commit 61417ed

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

juniper/src/schema/model.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,13 @@ pub enum DirectiveLocation {
9999

100100
/// Allows seeing [Type] with different name/string representations
101101
/// as the same type without allocating.
102-
///
103-
/// TODO: Ideally this type should not exist, but the reason it currently does
104-
/// is that [Type] is fully recursive, but recursive type references cannot really exist in GraphQL.
105-
/// (only one level of list-wrapping is allowed).
106-
/// If [Type] got properly "flattened" it would be easy to cheaply project a [Type<ArcStr>] as a [Type<&str>].
102+
//
103+
// TODO: Ideally this type should not exist, but the reason it currently does
104+
// is that [Type] has a recursive design to allow arbitrary number of list wrappings.
105+
// The list layout could instead be modelled as a modifier so that type becomes a tuple of (name, modifier).
106+
//
107+
// If [Type] is modelled like this it becomes easier to project it as a borrowed version of itself,
108+
// i.e. [Type<ArcStr>] vs [Type<&str>].
107109
#[derive(Clone, Copy, Debug)]
108110
pub enum DynType<'a> {
109111
Named(&'a str),

0 commit comments

Comments
 (0)