Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
graphql_core_schema
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
graphql_core_schema
Merge requests
!32
Revert "Fix error when resolving type for "File""
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Revert "Fix error when resolving type for "File""
issue/graphql_core_schema-3489139:fix_file_error
into
1.0.x
Overview
0
Commits
2
Pipelines
2
Changes
1
Open
abelass
requested to merge
issue/graphql_core_schema-3489139:fix_file_error
into
1.0.x
2 months ago
Overview
0
Commits
2
Pipelines
2
Changes
1
Expand
This reverts commit
b0e4011b
.
0
0
Merge request reports
Compare
1.0.x
version 1
788865e0
2 months ago
1.0.x (HEAD)
and
latest version
latest version
c7671c5d
2 commits,
2 months ago
version 1
788865e0
1 commit,
2 months ago
1 file
+
3
−
11
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/CoreComposableResolver.php
+
3
−
11
Options
@@ -29,7 +29,6 @@ use Drupal\Core\TypedData\Plugin\DataType\Timestamp;
use
Drupal\Core\TypedData\Plugin\DataType\Uri
;
use
Drupal\Core\TypedData\TypedDataInterface
;
use
Drupal\Core\Url
;
use
Drupal\file\FileInterface
;
use
Drupal\file\Plugin\Field\FieldType\FileFieldItemList
;
use
Drupal\graphql\GraphQL\Execution\ResolveContext
;
use
Drupal\graphql\GraphQL\ResolverBuilder
;
@@ -423,16 +422,9 @@ class CoreComposableResolver {
* The default type.
*/
public
static
function
resolveTypeDefault
(
$value
,
ResolveContext
$context
,
ResolveInfo
$info
)
{
$coreComposableConfig
=
CoreComposableConfig
::
fromConfiguration
(
$context
->
getServer
()
->
get
(
'schema_configuration'
)[
'core_composable'
]
??
[]);
if
(
$value
instanceof
FileInterface
)
{
// Special handling here because if we return "File" as a string,
// the execution resolver will call "is_callable('File')", which evaluates
// to true. This then ends up calling the PHP file() method without
// any arguments, which will throw an error.
return
$info
->
schema
->
getType
(
'File'
);
}
elseif
(
$value
instanceof
EntityInterface
)
{
return
$coreComposableConfig
->
getTypeNameForEntity
(
$value
);
if
(
$value
instanceof
EntityInterface
)
{
$type
=
EntitySchemaHelper
::
getGraphqlTypeForEntity
(
$value
);
return
$type
;
}
elseif
(
$value
instanceof
FieldItemInterface
)
{
return
EntitySchemaHelper
::
getTypeForFieldItem
(
$value
);
Loading