Skip to content

Commit

Permalink
Deployed 5f9c62b with MkDocs version: 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
olirice committed Oct 28, 2024
1 parent 739df56 commit 3e1ab04
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 33 deletions.
2 changes: 1 addition & 1 deletion assets/demo_schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ An opaque string using for tracking a position in results during pagination
"""
scalar Cursor

"""A date wihout time information"""
"""A date without time information"""
scalar Date

"""
Expand Down
18 changes: 18 additions & 0 deletions changelog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,13 @@
1.5.7
</a>

</li>

<li class="md-nav__item">
<a href="#158" class="md-nav__link">
1.5.8
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -827,6 +834,13 @@
1.5.7
</a>

</li>

<li class="md-nav__item">
<a href="#158" class="md-nav__link">
1.5.8
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -969,6 +983,10 @@ <h2 id="157">1.5.7</h2>
<li>bugfix: UDF argument with a complex default expression was marked as required</li>
<li>bugfix: not null foreign keys referencing tables with RLS are marked as nullable</li>
</ul>
<h2 id="158">1.5.8</h2>
<ul>
<li>bugfix: relational query with more than 100 fields fails</li>
</ul>
<h2 id="master">master</h2>


Expand Down
44 changes: 35 additions & 9 deletions contributing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,13 @@
Testing
</a>

</li>

<li class="md-nav__item">
<a href="#debugging" class="md-nav__link">
Debugging
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -595,6 +602,13 @@
Testing
</a>

</li>

<li class="md-nav__item">
<a href="#debugging" class="md-nav__link">
Debugging
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -660,20 +674,32 @@ <h1>Contributing</h1>

<p>pg_graphql is OSS. PR and issues are welcome.</p>
<h2 id="development">Development</h2>
<p>Requirements:</p>
<ul>
<li>rust</li>
<li>cargo</li>
<li><a href="https://github.com/tcdi/pgrx">pgrx</a></li>
</ul>
<p>To start developing <code>pg_graphql</code>:</p>
<ol>
<li><a href="https://www.rust-lang.org/tools/install">Install Rust</a>.</li>
<li><a href="https://github.com/pgcentralfoundation/pgrx">Install pgrx</a></li>
</ol>
<h3 id="testing">Testing</h3>
<p>Tests are located in <code>./test/sql</code> with expected output in <code>./test/expected</code></p>
<p>To run tests locally, execute:</p>
<p>Tests are located in sql files in the <code>./test/sql</code> folder. Each sql file has a corresponding expected output file in <code>./test/expected</code> folder. For example, <code>./test/sql/aliases.sql</code>'s expected output is in <code>./tests/expected/aliases.out</code>. When a test runs, its actual output is saved in the <code>./results</code> folder. If the file in <code>./results</code> folder matches the corresponding file in the <code>./test/expected</code> folder, the test passes, otherwise it fails.</p>
<p>To run tests locally, first execute:</p>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>cargo<span class="w"> </span>pgrx<span class="w"> </span>install
</code></pre></div></td></tr></table></div>
<p>to build <code>pg_graphql</code> from source and install it in the Postgres instance specified by <code>pg_config</code>. This step must be run when you have made any changes in the Rust code. It can be skipped if there are no Rust code changes since the last time the command was run. The skipping is expecially useful when you are only modifying the test sql files.</p>
<p>Next, run all the tests by executing:</p>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>./bin/installcheck
</code></pre></div></td></tr></table></div>
<p>You can combine the last two steps to build and install <code>pg_graphql</code> and run all the tests:</p>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>$<span class="w"> </span>cargo<span class="w"> </span>pgrx<span class="w"> </span>install<span class="p">;</span><span class="w"> </span>./bin/installcheck
</code></pre></div></td></tr></table></div>
<p>You can run a single test by passing its name to the <code>installcheck</code> command. For example, the following runs the test in <code>./test/sql/aliases.sql</code>.</p>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>./bin/installcheck<span class="w"> </span>aliases
</code></pre></div></td></tr></table></div>
<p>When writing a new test, or editing an existing one, the file in <code>./result</code> should be inspected manually and then copied over to the <code>./test/expected</code> folder to make the test pass.</p>
<h3 id="debugging">Debugging</h3>
<p>You can print to the output by using the <code>pgrx_pg_sys::submodules::elog::info!</code> macro in the Rust code. Lines printed with this macro will show in the .out file in the <code>./results</code> folder.</p>
<h3 id="interactive-psql-development">Interactive PSQL Development</h3>
<p>To reduce the iteration cycle, you may want to launch a psql prompt with <code>pg_graphql</code> installed to experiment</p>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>cargo<span class="w"> </span>pgrx<span class="w"> </span>run<span class="w"> </span>pg14
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>cargo<span class="w"> </span>pgrx<span class="w"> </span>run<span class="w"> </span>pg16
</code></pre></div></td></tr></table></div>
<p>Try out the commands below to spin up a database with the extension installed &amp; query a table using GraphQL. Experiment with aliasing field/table names and filtering on different columns.</p>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
Expand Down
2 changes: 1 addition & 1 deletion example_schema/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ <h1>Example Schema</h1>
<span class="c c-Multi">&quot;&quot;&quot;</span>
<span class="k">scalar</span> <span class="k">Cursor</span>

<span class="c c-Multi">&quot;&quot;&quot;A date wihout time information&quot;&quot;&quot;</span>
<span class="c c-Multi">&quot;&quot;&quot;A date without time information&quot;&quot;&quot;</span>
<span class="k">scalar</span> <span class="k">Date</span>

<span class="c c-Multi">&quot;&quot;&quot;</span>
Expand Down
6 changes: 3 additions & 3 deletions installation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -524,14 +524,14 @@ <h1>Installation</h1>
cargo<span class="w"> </span>pgrx<span class="w"> </span>install<span class="w"> </span>--release
</code></pre></div></td></tr></table></div>
<p>Before enabling the extension you need to initialize <code>pgrx</code>. The easiest way to get started is to allow <code>pgrx</code> to manage its own version/s of Postgres:</p>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>cargo<span class="w"> </span>pgrx<span class="w"> </span>init<span class="w"> </span>--pg16<span class="o">=</span>download
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>cargo<span class="w"> </span>pgrx<span class="w"> </span>init<span class="w"> </span>--pg17<span class="o">=</span>download
</code></pre></div></td></tr></table></div>
<p>For more advanced configuration options, like building against an existing Postgres installation from e.g. Homebrew, see the <a href="https://github.com/pgcentralfoundation/pgrx">pgrx docs</a></p>
<p>To start the database:</p>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>cargo<span class="w"> </span>pgrx<span class="w"> </span>start<span class="w"> </span>pg16
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>cargo<span class="w"> </span>pgrx<span class="w"> </span>start<span class="w"> </span>pg17
</code></pre></div></td></tr></table></div>
<p>To connect:</p>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>cargo<span class="w"> </span>pgrx<span class="w"> </span>connect<span class="w"> </span>pg16
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code>cargo<span class="w"> </span>pgrx<span class="w"> </span>connect<span class="w"> </span>pg17
</code></pre></div></td></tr></table></div>
<p>Finally, to enable the <code>pg_graphql</code> extension in Postgres, execute the <code>create extension</code> statement. This extension creates its own schema/namespace named <code>graphql</code> to avoid naming conflicts.</p>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><code><span class="k">create</span><span class="w"> </span><span class="k">extension</span><span class="w"> </span><span class="n">pg_graphql</span><span class="p">;</span>
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,82 +2,82 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://supabase.github.io/pg_graphql/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/api/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/changelog/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/computed_fields/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/configuration/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/contributing/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/example_schema/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/functions/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/installation/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/quickstart/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/security/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/sql_interface/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/supabase/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/usage_with_apollo/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/usage_with_relay/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://supabase.github.io/pg_graphql/views/</loc>
<lastmod>2024-07-10</lastmod>
<lastmod>2024-10-28</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified sitemap.xml.gz
Binary file not shown.
8 changes: 6 additions & 2 deletions usage_with_relay/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ <h3 id="configuring-the-relay-compiler">Configuring the Relay Compiler</h3>
<span class="w"> </span><span class="nx">nodeInterfaceIdField</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;nodeId&#39;</span><span class="p">,</span>
<span class="w"> </span><span class="nx">nodeInterfaceIdVariableName</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;nodeId&#39;</span><span class="p">,</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nx">customScalars</span><span class="o">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">customScalarTypes</span><span class="o">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">UUID</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;string&#39;</span><span class="p">,</span>
<span class="w"> </span><span class="nx">Datetime</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;string&#39;</span><span class="p">,</span>
<span class="w"> </span><span class="nb">JSON</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;string&#39;</span><span class="p">,</span>
Expand All @@ -682,8 +682,12 @@ <h3 id="configuring-the-relay-compiler">Configuring the Relay Compiler</h3>
</code></pre></div></td></tr></table></div>
<ul>
<li><code>schemaConfig</code> tells the Relay compiler where to find the <code>nodeId</code> field on the <code>node</code> interface</li>
<li><code>customScalars</code> will improve Relay's type emission</li>
<li><code>customScalarTypes</code> will improve Relay's type emission</li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>For Relay versions older than v16.2.0, it should be named <code>customScalars</code> instead.</p>
</div>
<h3 id="configuring-your-relay-environment">Configuring your Relay Environment</h3>
<p>This example uses <a href="https://supabase.com">Supabase</a> for the GraphQL server, but pg_graphql can be used independently.</p>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"> 1</span>
Expand Down

0 comments on commit 3e1ab04

Please sign in to comment.