Defining types using arrays may be error-prone, but graphql-php provides config validation
-tool to report when config has unexpected structure.
-
This validation tool is disabled by default because it is time-consuming operation which only
-makes sense during development.
-
To enable validation - call: GraphQL\Type\Definition\Config::enableValidation(); in your bootstrap
-but make sure to restrict it to debug/development mode only.
-
Type Registry
-
graphql-php expects that each type in Schema is presented with single instance. Therefore
-if you define your types as separate PHP classes you need to ensure that each type is referenced only once.
-
Technically you can create several instances of your type (for example for tests), but GraphQL\Schema
-will throw on attempt to add different instances with the same name.
-
There are several ways to achieve this depending on your preferences. We provide reference
-implementation below that introduces TypeRegistry class:
-
-
-
diff --git a/index.html b/index.html
index 338d990..cd2d24f 100755
--- a/index.html
+++ b/index.html
@@ -255,7 +255,7 @@ existing PHP frameworks, add support for Relay, etc.
Current version (v0.8) supports all features described by GraphQL specification
(including April 2016 add-ons) as well as some experimental features like
Schema Language parser.
@@ -303,5 +303,5 @@ Schema Language parser.
diff --git a/mkdocs/search_index.json b/mkdocs/search_index.json
index 2b649b1..61d698d 100755
--- a/mkdocs/search_index.json
+++ b/mkdocs/search_index.json
@@ -2,7 +2,7 @@
"docs": [
{
"location": "/",
- "text": "About GraphQL\n\n\nGraphQL is a modern way to build HTTP APIs consumed by web and mobile clients.\nIt is intended to be a replacement for REST and SOAP APIs (even for \nexisting applications\n).\n\n\nGraphQL itself is a \nspecification\n designed by Facebook\nengineers. Various implementations of this specification were written \n\nfor different languages and environments\n.\n\n\nGreat overview of GraphQL features and benefits is presented on \nofficial website\n. \nAll of them equally apply to this PHP implementation. \n\n\nAbout graphql-php\n\n\ngraphql-php\n is a feature-complete implementation of GraphQL specification in PHP (5.4+, 7.0+). \nIt was originally inspired by \nreference JavaScript implementation\n \npublished by Facebook.\n\n\nThis library is a thin wrapper around your existing data layer and business logic. \nIt doesn't dictate how these layers are implemented or which storage engines \nare used. Instead it provides tools for creating rich API for your existing app. \n\n\nThese tools include:\n\n\n\n\nPrimitives to express your app as a Type System\n\n\nTools for validation and introspection of this Type System (for compatibility with tools like \nGraphiQL\n)\n\n\nTools for parsing, validating and executing GraphQL queries against this Type System\n\n\nRich error reporting, including query validation and execution errors\n\n\nOptional tools for parsing GraphQL Schema Definition language\n\n\n\n\nAlso several \ncomplementary tools\n are available which provide integrations with \nexisting PHP frameworks, add support for Relay, etc.\n\n\nCurrent Status\n\n\nFirst version of this library (v0.1) was released on August 10th 2015.\n\n\nCurrent version (v0.8) supports all features described by GraphQL specification \n(including April 2016 add-ons) as well as some experimental features like \nSchema Language parser.\n\n\nReady for real-world usage.\n\n\nGithub\n\n\nProject source code is \nhosted on GitHub\n.",
+ "text": "About GraphQL\n\n\nGraphQL is a modern way to build HTTP APIs consumed by web and mobile clients.\nIt is intended to be a replacement for REST and SOAP APIs (even for \nexisting applications\n).\n\n\nGraphQL itself is a \nspecification\n designed by Facebook\nengineers. Various implementations of this specification were written \n\nfor different languages and environments\n.\n\n\nGreat overview of GraphQL features and benefits is presented on \nofficial website\n. \nAll of them equally apply to this PHP implementation. \n\n\nAbout graphql-php\n\n\ngraphql-php\n is a feature-complete implementation of GraphQL specification in PHP (5.4+, 7.0+). \nIt was originally inspired by \nreference JavaScript implementation\n \npublished by Facebook.\n\n\nThis library is a thin wrapper around your existing data layer and business logic. \nIt doesn't dictate how these layers are implemented or which storage engines \nare used. Instead it provides tools for creating rich API for your existing app. \n\n\nThese tools include:\n\n\n\n\nPrimitives to express your app as a Type System\n\n\nTools for validation and introspection of this Type System (for compatibility with tools like \nGraphiQL\n)\n\n\nTools for parsing, validating and executing GraphQL queries against this Type System\n\n\nRich error reporting, including query validation and execution errors\n\n\nOptional tools for parsing GraphQL Schema Definition language\n\n\n\n\nAlso several \ncomplementary tools\n are available which provide integrations with \nexisting PHP frameworks, add support for Relay, etc.\n\n\nCurrent Status\n\n\nFirst version of this library (v0.1) was released on August 10th 2015.\n\n\nCurrent version (v0.8) supports all features described by GraphQL specification \n(including April 2016 add-ons) as well as some experimental features like \nSchema Language parser.\n\n\nReady for real-world usage. \n\n\nGithub\n\n\nProject source code is \nhosted on GitHub\n.",
"title": "About"
},
{