File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55use GraphQL \GraphQL ;
66use GraphQL \Utils \BuildSchema ;
77
8- try {
9- $ resolveEcho = require "echo.php " ;
10- $ resolveSum = require "sum.php " ;
8+ $ resolveEcho = require "echo.php " ;
9+ $ resolveSum = require "sum.php " ;
1110
11+ try {
1212 $ schema = file_get_contents ("schema.graphql " );
1313 $ schema = BuildSchema::build ($ schema );
1414 $ rootValue = [
1515 "echo " => $ resolveEcho ,
1616 "sum " => $ resolveSum ,
17- "prefix " => "" ,
17+ "prefix " => "Welcome, Dear " ,
1818 ];
1919
2020 if (isset ($ _POST ["submit " ])) {
2828 $ variableValues = $ input ["variables " ] ?? null ;
2929
3030 if ($ input === null ) {
31- print "<form action= " " method="POST ">";
31+ print "<form action= \"\ " method= \ "POST \ "> " ;
3232 print "<b>Query:</b><br> " ;
33- print " <textarea name="query"></textarea>";
33+ print "<textarea name= \ "query \ "></textarea> " ;
3434 print "<br> " ;
3535 print "<b>Variables:</b><br> " ;
36- print " <textarea name="variables"></textarea>";
36+ print "<textarea name= \ "variables \ "></textarea> " ;
3737 print "<br> " ;
38- print " <button name="submit">Submit</button>";
38+ print "<button name= \ "submit \ ">Submit</button> " ;
3939 print "</form> " ;
4040 exit ();
4141 }
You can’t perform that action at this time.
0 commit comments