We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 034745c commit 6d2e2edCopy full SHA for 6d2e2ed
examples/helloworld/index.php
@@ -0,0 +1,28 @@
1
+<?php
2
+// include the php-graphql-autoloader
3
+require '../../src/autoloader.php';
4
+
5
+use GraphQL\Types\GraphQLObjectType;
6
+use GraphQL\Fields\GraphQLTypeField;
7
+use GraphQL\Types\GraphQLString;
8
+use GraphQL\Schemas\Schema;
9
+use GraphQL\Servers\Server;
10
11
+// build the query type
12
+$QueryType = new GraphQLObjectType("Query", "Root Query", function (){
13
+ return [
14
+ new GraphQLTypeField(
15
+ "hello",
16
+ new GraphQLString(),
17
+ "Your first hello world GraphQL-Application",
18
+ function (){ return 'Hello world!'; }
19
+ )
20
+ ];
21
+});
22
23
+// build the schema
24
+$schema = new Schema($QueryType);
25
26
+// start a server
27
+$server = new Server($schema);
28
+$server->listen();
0 commit comments