File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
versioned_docs/version-6.0 Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -383,7 +383,7 @@ in the **ISO8601** format (aka ATOM format).
383383
384384## Union types
385385
386- You can create a GraphQL union type * on the fly * using the pipe ` | ` operator in the PHPDoc :
386+ Union types for return are supported in GraphQLite as of version 6.0 :
387387
388388<Tabs
389389 defaultValue = " php8"
@@ -394,11 +394,8 @@ You can create a GraphQL union type *on the fly* using the pipe `|` operator in
394394 <TabItem value = " php8" >
395395
396396``` php
397- /**
398- * @return Company|Contact <== can return a company OR a contact.
399- */
400397#[Query]
401- public function companyOrContact(int $id)
398+ public function companyOrContact(int $id): Company|Contact
402399{
403400 // Some code that returns a company or a contact.
404401}
@@ -410,7 +407,7 @@ public function companyOrContact(int $id)
410407``` php
411408/**
412409 * @Query
413- * @return Company|Contact <== can return a company OR a contact.
410+ * @return Company|Contact
414411 */
415412public function companyOrContact(int $id)
416413{
Original file line number Diff line number Diff line change @@ -383,7 +383,7 @@ in the **ISO8601** format (aka ATOM format).
383383
384384## Union types
385385
386- You can create a GraphQL union type * on the fly * using the pipe ` | ` operator in the PHPDoc :
386+ Union types for return are supported in GraphQLite as of version 6.0 :
387387
388388<Tabs
389389 defaultValue = " php8"
@@ -394,11 +394,8 @@ You can create a GraphQL union type *on the fly* using the pipe `|` operator in
394394 <TabItem value = " php8" >
395395
396396``` php
397- /**
398- * @return Company|Contact <== can return a company OR a contact.
399- */
400397#[Query]
401- public function companyOrContact(int $id)
398+ public function companyOrContact(int $id): Company|Contact
402399{
403400 // Some code that returns a company or a contact.
404401}
@@ -410,7 +407,7 @@ public function companyOrContact(int $id)
410407``` php
411408/**
412409 * @Query
413- * @return Company|Contact <== can return a company OR a contact.
410+ * @return Company|Contact
414411 */
415412public function companyOrContact(int $id)
416413{
You can’t perform that action at this time.
0 commit comments