Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/GraphQL/Types/EntryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ public function fields(): array
],
'date' => new DateField,
'last_modified' => new DateField,
'locale' => [
'type' => GraphQL::nonNull(GraphQL::string()),
],
'site' => [
'type' => GraphQL::nonNull(GraphQL::type(SiteType::NAME)),
],
];

foreach ($this->extraFields() as $field => $closure) {
Expand Down
10 changes: 10 additions & 0 deletions tests/Feature/GraphQL/EntryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public function it_queries_an_entry_by_id()
title
handle
}
locale
site {
handle
name
}
}
}
GQL;
Expand All @@ -69,6 +74,11 @@ public function it_queries_an_entry_by_id()
'title' => 'Events',
'handle' => 'events',
],
'locale' => 'en',
'site' => [
'handle' => 'en',
'name' => 'English',
],
],
]]);
}
Expand Down