Skip to content

Commit

Permalink
deploy: e14bc28
Browse files Browse the repository at this point in the history
  • Loading branch information
gabotechs committed Mar 18, 2024
1 parent 559f3c7 commit 0e6a7a4
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 73 deletions.
6 changes: 3 additions & 3 deletions features/imports.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ <h1 id="imports"><a class="header" href="#imports">Imports</a></h1>
</code></pre>
<pre><code class="language-graphql"># product.graphqxl

import &quot;common-stuff&quot;
import "common-stuff"

type Product {
id: Identifier
Expand Down Expand Up @@ -228,8 +228,8 @@ <h1 id="imports"><a class="header" href="#imports">Imports</a></h1>
</tbody>
</table>
<p>A good pattern for keeping your schema clean could look something like this:</p>
<pre><code class="language-graphql">import &quot;products&quot;
import &quot;users&quot;
<pre><code class="language-graphql">import "products"
import "users"
# import other entities

type Query {
Expand Down
40 changes: 20 additions & 20 deletions features/inheritance.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,17 +191,17 @@ <h2 id="spread-operator"><a class="header" href="#spread-operator">Spread operat
<tr>
<td >
<pre><code class="language-graphql">type Common {
&quot;Type's ID&quot;
"Type's ID"
id: ID!
&quot;Type's Name&quot;
"Type's Name"
name: String!
&quot;Type's description&quot;
"Type's description"
description: String!
}

type Product {
...Common
&quot;Product's price&quot;
"Product's price"
price: Float!
}

Expand All @@ -213,22 +213,22 @@ <h2 id="spread-operator"><a class="header" href="#spread-operator">Spread operat
</td>
<td>
<pre><code class="language-graphql">type Common {
&quot;Type's ID&quot;
"Type's ID"
id: ID!
&quot;Type's Name&quot;
"Type's Name"
name: String!
&quot;Type's description&quot;
"Type's description"
description: String!
}

type Product {
&quot;Type's ID&quot;
"Type's ID"
id: ID!
&quot;Type's Name&quot;
"Type's Name"
name: String!
&quot;Type's description&quot;
"Type's description"
description: String!
&quot;Product's price&quot;
"Product's price"
price: Float!
}
</code></pre>
Expand All @@ -238,7 +238,7 @@ <h2 id="spread-operator"><a class="header" href="#spread-operator">Spread operat
</table>
<h2 id="private-fields"><a class="header" href="#private-fields">Private fields</a></h2>
<p>It is very common that you do not want to expose the <code>Common</code> type in the public API,
so you can make it private by prefixing the name with a <code>_</code> character (or the
so you can make it private by prefixing the name with a <code>_</code> character (or the
prefix that you provide in the CLI argument):</p>
<p><a href="https://graphqxl-explorer.vercel.app/?code=dHlwZSBfQ29tbW9uIHsKICAgICJUeXBlJ3MgSUQiCiAgICBpZDogSUQhCiAgICAiVHlwZSdzIE5hbWUiCiAgICBuYW1lOiBTdHJpbmchCiAgICAiVHlwZSdzIGRlc2NyaXB0aW9uIgogICAgZGVzY3JpcHRpb246IFN0cmluZyEKfQoKdHlwZSBQcm9kdWN0IHsKICAgIC4uLl9Db21tb24KICAgICJQcm9kdWN0J3MgcHJpY2UiCiAgICBwcmljZTogRmxvYXQhCn0=">Open in sandbox</a></p>
<table style="width: 100%">
Expand All @@ -252,30 +252,30 @@ <h2 id="private-fields"><a class="header" href="#private-fields">Private fields<
<tr>
<td>
<pre><code class="language-graphql">type _Common {
&quot;Type's ID&quot;
"Type's ID"
id: ID!
&quot;Type's Name&quot;
"Type's Name"
name: String!
&quot;Type's description&quot;
"Type's description"
description: String!
}

type Product {
..._Common
&quot;Product's price&quot;
"Product's price"
price: Float!
}
</code></pre>
</td>
<td>
<pre><code class="language-graphql">type Product {
&quot;Type's ID&quot;
"Type's ID"
id: ID!
&quot;Type's Name&quot;
"Type's Name"
name: String!
&quot;Type's description&quot;
"Type's description"
description: String!
&quot;Product's price&quot;
"Product's price"
price: Float!
}

Expand Down
6 changes: 3 additions & 3 deletions features/modifiers.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ <h1 id="modifiers"><a class="header" href="#modifiers">Modifiers</a></h1>
<p>These are the currently available modifiers:</p>
<h2 id="optional"><a class="header" href="#optional">Optional</a></h2>
<p>The <code>Optional</code> modifier takes a <code>type</code> or an <code>input</code> as a parameter and outputs a
similar object with all its fields marked as &quot;nullable&quot;. If the field in the original
similar object with all its fields marked as "nullable". If the field in the original
object was declared required with a <code>!</code> the output will contain that field without
the <code>!</code>, otherwise the field is left untouched.</p>
<p><a href="https://graphqxl-explorer.vercel.app/?code=dHlwZSBfU29tZVR5cGUgewogICAgZm9vOiBTdHJpbmchCiAgICBiYXI6IEludCEKICAgIGJvb2w6IFtGbG9hdCFdCn0KCnR5cGUgT3B0aW9uYWxUeXBlID0gT3B0aW9uYWw8X1NvbWVUeXBlPg==">Open in sandbox</a></p>
Expand Down Expand Up @@ -218,8 +218,8 @@ <h2 id="optional"><a class="header" href="#optional">Optional</a></h2>
</table>
<h2 id="required"><a class="header" href="#required">Required</a></h2>
<p>The <code>Required</code> modifier takes a <code>type</code> or an <code>input</code> as a parameter and outputs a
similar object with all its fields marked as &quot;non-nullable&quot;. If a field in the original
object did not have a <code>!</code>, it will have it in the new object, otherwise it will be
similar object with all its fields marked as "non-nullable". If a field in the original
object did not have a <code>!</code>, it will have it in the new object, otherwise it will be
left untouched</p>
<p><a href="https://graphqxl-explorer.vercel.app/?code=dHlwZSBfU29tZVR5cGUgewogICAgZm9vOiBTdHJpbmcKICAgIGJhcjogSW50CiAgICBib29sOiBbRmxvYXRdIQp9Cgp0eXBlIFJlcXVpcmVkVHlwZSA9IFJlcXVpcmVkPF9Tb21lVHlwZT4=">Open in sandbox</a></p>
<table style="width: 100%">
Expand Down
14 changes: 7 additions & 7 deletions features/templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ <h1 id="description-templates"><a class="header" href="#description-templates">D
<tr>
<td>
<pre><code class="language-graphql">type _ToBeReused {
&quot;Field foo from type 'ToBeReused'&quot;
"Field foo from type 'ToBeReused'"
foo: String!
}

Expand All @@ -197,7 +197,7 @@ <h1 id="description-templates"><a class="header" href="#description-templates">D
</td>
<td>
<pre><code class="language-graphql">input Bar {
&quot;Field foo from type 'ToBeReused'&quot;
"Field foo from type 'ToBeReused'"
foo: String!
}

Expand All @@ -212,12 +212,12 @@ <h1 id="description-templates"><a class="header" href="#description-templates">D
<p>There, <code>foo</code>'s description says that the field <code>foo</code> belongs to the type <code>ToBeReused</code>,
but once that is compiled it is not true, it should say something like:</p>
<pre><code class="language-graphql">input Bar {
&quot;Field foo from input 'Bar'&quot;
"Field foo from input 'Bar'"
foo: String!
}
</code></pre>
<h2 id="description-string-interpolation"><a class="header" href="#description-string-interpolation">Description string interpolation</a></h2>
<p>You can use template variables in the description strings to refer to some
<p>You can use template variables in the description strings to refer to some
contextual values:</p>
<p><a href="https://graphqxl-explorer.vercel.app/?code=dHlwZSBfVG9CZVJldXNlZCB7CiAgICAiRmllbGQgZm9vIGZyb20gJHt7IGJsb2NrLnR5cGUgfX0gJyR7eyBibG9jay5uYW1lIH19JyIKICAgIGZvbzogU3RyaW5nIQp9CgppbnB1dCBCYXIgewogICAgLi4uX1RvQmVSZXVzZWQKfQoKdHlwZSBCYXogewogICAgLi4uX1RvQmVSZXVzZWQKfQ==">Open in sandbox</a></p>
<table style="width: 100%">
Expand All @@ -231,7 +231,7 @@ <h2 id="description-string-interpolation"><a class="header" href="#description-s
<tr>
<td>
<pre><code class="language-graphql">type _ToBeReused {
&quot;Field foo from ${{ block.type }} '${{ block.name }}'&quot;
"Field foo from ${{ block.type }} '${{ block.name }}'"
foo: String!
}

Expand All @@ -246,12 +246,12 @@ <h2 id="description-string-interpolation"><a class="header" href="#description-s
</td>
<td>
<pre><code class="language-graphql">input Bar {
&quot;Field foo from input 'Bar'&quot;
"Field foo from input 'Bar'"
foo: String!
}

type Baz {
&quot;Field foo from type 'Baz'&quot;
"Field foo from type 'Baz'"
foo: String!
}

Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ <h1 class="menu-title">GraphQXL book</h1>
<ul>
<li>
<p>With a <strong>code-first</strong> approach, you have all the tools the programming language
you are using provides, like functions for automatically generating repetitive
you are using provides, like functions for automatically generating repetitive
types, inheritance for reusing code pieces, and so on.</p>
</li>
<li>
<p>With a <strong>schema-first</strong> approach you need to write by hand all the repetitive entities
in your schema, and if you want to split your schema across different files for a better
in your schema, and if you want to split your schema across different files for a better
maintainability you are bound to language-specific tools for merging them.</p>
</li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ <h1 class="menu-title">GraphQXL book</h1>
<ul>
<li>
<p>With a <strong>code-first</strong> approach, you have all the tools the programming language
you are using provides, like functions for automatically generating repetitive
you are using provides, like functions for automatically generating repetitive
types, inheritance for reusing code pieces, and so on.</p>
</li>
<li>
<p>With a <strong>schema-first</strong> approach you need to write by hand all the repetitive entities
in your schema, and if you want to split your schema across different files for a better
in your schema, and if you want to split your schema across different files for a better
maintainability you are bound to language-specific tools for merging them.</p>
</li>
</ul>
Expand Down
Loading

0 comments on commit 0e6a7a4

Please sign in to comment.