mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-22 12:56:05 +03:00
Deployed 0483560
with MkDocs version: 0.15.3
This commit is contained in:
parent
24bd801ff1
commit
21e2f15617
@ -1,285 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
|
||||||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<title>Best Practices - graphql-php</title>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="shortcut icon" href="../img/favicon.ico">
|
|
||||||
|
|
||||||
|
|
||||||
<link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="../css/theme.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
|
|
||||||
<link rel="stylesheet" href="../css/highlight.css">
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// Current page data
|
|
||||||
var mkdocs_page_name = "Best Practices";
|
|
||||||
var mkdocs_page_input_path = "best-practices.md";
|
|
||||||
var mkdocs_page_url = "/best-practices/";
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script src="../js/jquery-2.1.1.min.js"></script>
|
|
||||||
<script src="../js/modernizr-2.8.3.min.js"></script>
|
|
||||||
<script type="text/javascript" src="../js/highlight.pack.js"></script>
|
|
||||||
<script src="../js/theme.js"></script>
|
|
||||||
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body class="wy-body-for-nav" role="document">
|
|
||||||
|
|
||||||
<div class="wy-grid-for-nav">
|
|
||||||
|
|
||||||
|
|
||||||
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
|
|
||||||
<div class="wy-side-nav-search">
|
|
||||||
<a href=".." class="icon icon-home"> graphql-php</a>
|
|
||||||
<div role="search">
|
|
||||||
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
|
|
||||||
<input type="text" name="q" placeholder="Search docs" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
|
||||||
<ul class="current">
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="..">About</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../getting-started/">Getting Started</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<ul class="subnav">
|
|
||||||
<li><span>Type System</span></li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../type-system/">Introduction</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../type-system/object-types/">Object Types</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../type-system/scalar-types/">Scalar Types</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../type-system/enum-types/">Enumeration Types</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../type-system/lists-and-nonnulls/">Lists and Non-Null</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../type-system/interfaces/">Interfaces</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../type-system/unions/">Unions</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../type-system/input-types/">Input Types</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../type-system/directives/">Directives</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../type-system/schema/">Schema</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../executing-queries/">Executing Queries</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../error-handling/">Handling Errors</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../data-fetching/">Fetching Data</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<li class="toctree-l1 current">
|
|
||||||
<a class="current" href="./">Best Practices</a>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
|
|
||||||
<li class="toctree-l3"><a href="#config-validation">Config Validation</a></li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="toctree-l3"><a href="#type-registry">Type Registry</a></li>
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<li class="toctree-l1 ">
|
|
||||||
<a class="" href="../complementary-tools/">Complementary Tools</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
|
||||||
|
|
||||||
|
|
||||||
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
|
||||||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
||||||
<a href="..">graphql-php</a>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wy-nav-content">
|
|
||||||
<div class="rst-content">
|
|
||||||
<div role="navigation" aria-label="breadcrumbs navigation">
|
|
||||||
<ul class="wy-breadcrumbs">
|
|
||||||
<li><a href="..">Docs</a> »</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li>Best Practices</li>
|
|
||||||
<li class="wy-breadcrumbs-aside">
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<hr/>
|
|
||||||
</div>
|
|
||||||
<div role="main">
|
|
||||||
<div class="section">
|
|
||||||
|
|
||||||
<h1 id="config-validation">Config Validation</h1>
|
|
||||||
<p>Defining types using arrays may be error-prone, but <strong>graphql-php</strong> provides config validation
|
|
||||||
tool to report when config has unexpected structure. </p>
|
|
||||||
<p>This validation tool is <strong>disabled by default</strong> because it is time-consuming operation which only
|
|
||||||
makes sense during development.</p>
|
|
||||||
<p>To enable validation - call: <code>GraphQL\Type\Definition\Config::enableValidation();</code> in your bootstrap
|
|
||||||
but make sure to restrict it to debug/development mode only.</p>
|
|
||||||
<h1 id="type-registry">Type Registry</h1>
|
|
||||||
<p><strong>graphql-php</strong> 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.</p>
|
|
||||||
<p>Technically you can create several instances of your type (for example for tests), but <code>GraphQL\Schema</code>
|
|
||||||
will throw on attempt to add different instances with the same name.</p>
|
|
||||||
<p>There are several ways to achieve this depending on your preferences. We provide reference
|
|
||||||
implementation below that introduces TypeRegistry class:</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<footer>
|
|
||||||
|
|
||||||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
||||||
|
|
||||||
<a href="../complementary-tools/" class="btn btn-neutral float-right" title="Complementary Tools">Next <span class="icon icon-circle-arrow-right"></span></a>
|
|
||||||
|
|
||||||
|
|
||||||
<a href="../data-fetching/" class="btn btn-neutral" title="Fetching Data"><span class="icon icon-circle-arrow-left"></span> Previous</a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div role="contentinfo">
|
|
||||||
<!-- Copyright etc -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="rst-versions" role="note" style="cursor: pointer">
|
|
||||||
<span class="rst-current-version" data-toggle="rst-current-version">
|
|
||||||
|
|
||||||
|
|
||||||
<span><a href="../data-fetching/" style="color: #fcfcfc;">« Previous</a></span>
|
|
||||||
|
|
||||||
|
|
||||||
<span style="margin-left: 15px"><a href="../complementary-tools/" style="color: #fcfcfc">Next »</a></span>
|
|
||||||
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -255,7 +255,7 @@ existing PHP frameworks, add support for Relay, etc.</p>
|
|||||||
<p>Current version (v0.8) supports all features described by GraphQL specification
|
<p>Current version (v0.8) supports all features described by GraphQL specification
|
||||||
(including April 2016 add-ons) as well as some experimental features like
|
(including April 2016 add-ons) as well as some experimental features like
|
||||||
Schema Language parser.</p>
|
Schema Language parser.</p>
|
||||||
<p>Ready for real-world usage.</p>
|
<p>Ready for real-world usage. </p>
|
||||||
<h2 id="github">Github</h2>
|
<h2 id="github">Github</h2>
|
||||||
<p>Project source code is <a href="https://github.com/webonyx/graphql-php">hosted on GitHub</a>.</p>
|
<p>Project source code is <a href="https://github.com/webonyx/graphql-php">hosted on GitHub</a>.</p>
|
||||||
|
|
||||||
@ -303,5 +303,5 @@ Schema Language parser.</p>
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
MkDocs version : 0.15.3
|
MkDocs version : 0.15.3
|
||||||
Build Date UTC : 2016-12-14 13:30:22.628000
|
Build Date UTC : 2016-12-14 13:34:54.150000
|
||||||
-->
|
-->
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"docs": [
|
"docs": [
|
||||||
{
|
{
|
||||||
"location": "/",
|
"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"
|
"title": "About"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user