How to create recursive hierarchy? #1227
Answered
by
spawnia
Kagayakashi
asked this question in
Q&A
-
I want to create recursive hierarchy as tree-like structure. $fieldOptionsType = new ObjectType([
'name' => 'Options',
'fields' => [
'nested' => [
'type' => Type::listOf($fieldType), // $fieldType not initialized yet.
],
],
]);
$fieldType = new ObjectType([
'name' => 'Field',
'fields' => [
'options' => [
'type' => $fieldOptionsType,
],
],
]); I have problem, that variable |
Beta Was this translation helpful? Give feedback.
Answered by
spawnia
Oct 3, 2022
Replies: 1 comment
-
See https://webonyx.github.io/graphql-php/type-definitions/object-types/#recurring-and-circular-types |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kagayakashi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See https://webonyx.github.io/graphql-php/type-definitions/object-types/#recurring-and-circular-types