Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
graphql_twig
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_twig
Commits
47523310
Commit
47523310
authored
7 months ago
by
Eli Stone
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3404044
by InaW, larskleiner: Call to undefined method error when twig debug mode is enabled
parent
96593c60
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#227872
failed
7 months ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
assets/debug.js
+1
-3
1 addition, 3 deletions
assets/debug.js
src/GraphQLTemplateTrait.php
+4
-6
4 additions, 6 deletions
src/GraphQLTemplateTrait.php
with
5 additions
and
9 deletions
assets/debug.js
+
1
−
3
View file @
47523310
...
...
@@ -8,9 +8,7 @@
let
variables
=
element
.
dataset
.
graphqlVariables
;
const
form
=
document
.
createElement
(
'
form
'
);
form
.
action
=
Drupal
.
url
(
`admin/config/graphql/servers/manage/
${
server
}
/explorer`
);
form
.
action
=
Drupal
.
url
(
'
graphql/explorer
'
);
form
.
method
=
'
post
'
;
form
.
target
=
'
_blank
'
;
...
...
This diff is collapsed.
Click to expand it.
src/GraphQLTemplateTrait.php
+
4
−
6
View file @
47523310
...
...
@@ -108,18 +108,17 @@ trait GraphQLTemplateTrait {
if
(
$this
->
env
->
isDebug
()
&&
$debug_placement
==
'wrapped'
)
{
printf
(
'<div class="%s" data-graphql-query="%s" data-graphql-variables="%s"
data-graphql-server="%s"
>'
,
'<div class="%s" data-graphql-query="%s" data-graphql-variables="%s">'
,
'graphql-twig-debug-wrapper'
,
htmlspecialchars
(
$query
),
htmlspecialchars
(
json_encode
(
$arguments
)),
$this
->
env
->
getGraphQlServer
()
->
id
()
);
}
if
(
$this
->
env
->
isDebug
()
&&
$queryResult
->
errors
)
{
print
(
'<ul class="graphql-twig-errors">'
);
foreach
(
$queryResult
->
errors
as
$error
)
{
printf
(
'<li>%s</li>'
,
$error
->
m
essage
);
printf
(
'<li>%s</li>'
,
$error
->
getM
essage
()
);
}
print
(
'</ul>'
);
}
...
...
@@ -133,11 +132,10 @@ trait GraphQLTemplateTrait {
if
(
$this
->
env
->
isDebug
()
&&
$debug_placement
==
'inside'
)
{
$context
[
'graphql_debug'
]
=
[
'#markup'
=>
sprintf
(
'<div class="graphql-twig-debug-child"><div class="%s" data-graphql-query="%s" data-graphql-variables="%s"
data-graphql-server="%s"
></div></div>'
,
'<div class="graphql-twig-debug-child"><div class="%s" data-graphql-query="%s" data-graphql-variables="%s"></div></div>'
,
'graphql-twig-debug-wrapper'
,
htmlspecialchars
(
$query
),
htmlspecialchars
(
json_encode
(
$arguments
)),
$this
->
env
->
getGraphQlServer
()
->
id
()
htmlspecialchars
(
json_encode
(
$arguments
))
),
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment