fauna-gql-upload
Version:
Manage your FaunaDB resources in within your project and upload them using a single command
256 lines (194 loc) • 7.71 kB
HTML
<html lang="en">
<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>Command-line options - Fauna GQL Upload</title>
<link rel="preconnect" href="https://cdnjs.cloudflare.com" />
<link rel="preconnect" href="https://arc.io" />
<link rel="preconnect" href="https://viewm.moonicorn.network" />
<link rel="preconnect" href="https://plausible.io" />
<link rel="stylesheet" href="../../css/main.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/themes/prism-okaidia.css" integrity="sha512-lTmd0bFMM2Ttm/S8V5dywYNiJaSyF5PILZosvAIzW4EJ7JLEYflk9ImyYIxw5KlFz7e9ZCJN53rnvPnefD240w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/prism.min.js" integrity="sha512-YBk7HhgDZvBxmtOfUdvX0z8IH2d10Hp3aEygaMNhtF8fSOvBZ16D/1bXZTJV6ndk/L/DlXxYStP8jrF77v2MIg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script async src="https://arc.io/widget.min.js#3ua6mscf"></script>
<script async defer data-domain="fgu-docs.com" src="https://plausible.io/js/plausible.js"></script>
</head>
<body>
<header>
<button class="icon-button hamburger">
<img src="../../img/hamburger.svg" />
</button>
<h1 class="title">Fauna GQL Upload</h1>
<div class="social">
<a href="https://github.com/Plazide/fauna-gql-upload">
<img alt="Github" src="../../img/github.png" />
</a>
<a href="https://twitter.com/chj_web">
<img alt="Twitter" src="../../img/twitter.png" />
</a>
</div>
</header>
<nav class="nav">
<header>
<button onclick="toggleNavigation()" class="icon-button backburger">
<img src="../../img/backburger.svg" />
</button>
<h1 class="title">Fauna GQL Upload</h1>
</header>
<ul class="list">
<li >
<a href="../..">✨ Introduction</a>
</li>
<li >
<a href="../../getting-started/">🏹 Getting started</a>
</li>
<li class="active dropdown">
<button class="dropdown-button">
⌨️ Configuration
<img class="chevron" alt="chevron" src="../../img/chevron.svg" />
</button>
<ul class="list">
<li >
<a href="../config-file/">Config file</a>
</li>
<li class="active">
<a href="./">Command-line options</a>
</li>
<li >
<a href="../local-development/">Local development</a>
</li>
</ul>
</li>
<li class="dropdown">
<button class="dropdown-button">
🤹 Usage
<img class="chevron" alt="chevron" src="../../img/chevron.svg" />
</button>
<ul class="closed list">
<li >
<a href="../../usage/upload-schema/">Upload schema</a>
</li>
<li >
<a href="../../usage/upload-functions/">Upload functions</a>
</li>
<li >
<a href="../../usage/upload-indexes/">Upload indexes</a>
</li>
<li >
<a href="../../usage/upload-roles/">Upload roles</a>
</li>
<li >
<a href="../../usage/upload-data/">Upload data</a>
</li>
<li >
<a href="../../usage/upload-access-providers/">Upload access providers</a>
</li>
<li >
<a href="../../usage/graphql-code-generator/">GraphQL code generator</a>
</li>
<li >
<a href="../../usage/with-typescript/">With typescript</a>
</li>
</ul>
</li>
<li >
<a href="../../contributing/">💡 Contributing</a>
</li>
<li >
<a href="../../problems-or-issues/">❌ Problems or issues?</a>
</li>
</ul>
<footer>
<a href="https://github.com/Plazide/fauna-gql-upload">
<img alt="Github" src="../../img/github.png" />
</a>
<a href="https://twitter.com/chj_web">
<img alt="Twitter" src="../../img/twitter.png" />
</a>
</footer>
</nav>
<main class="main"><h1 id="command-line-options">Command-line options</h1>
<p>The properties listed under <a href="/configuration/config-file">config file</a> can also be specified as command-line options. You would use the name of the property in either camelCase, <code>fgu --secretEnv SECRET</code>, or kebab-case, <code>fgu --secret-env SECRET</code>.</p>
<p>The main use-cases for command-line options are to specify different config files or environment files.</p>
<p>To change the config file to be used, you would use something like this:</p>
<pre><code class="language-sh">fgu --config fauna.prod.json
</code></pre>
<blockquote>
<p><strong>NOTE:</strong> The config file still has to be in a JSON format.</p>
</blockquote>
<p>To specify a different environment file, you would do something like this:</p>
<pre><code class="language-sh">fgu --envPath .production.env
</code></pre>
<h2 id="codegen">Codegen</h2>
<p>To use GraphQL codegen through command-line options, you need to first provide the <code>--codegen</code> option and then the desired options. All of the codegen options are prefixed with <code>codegen</code> followed by the name specified in the <a href="/configuration/config-file">config file table</a>.</p>
<p>The only options that are not the same as their config property counter-parts are the <code>--codegenDisableTypescript</code>, which corresponds to <code>codegen.typescript</code>, and <code>--codegenDisableOperations</code>, which corresponds to <code>codegen.operations</code>, options. These control default GraphQL codegen plugins which are enabled by default.</p>
<p>An example of usage with GraphQL codegen would be:</p>
<pre><code class="language-sh">fgu --codegen --codegenPlugins typescript-urql --codegenPluginOptions '{ \"omitOperationSuffix\": true }'
</code></pre>
<blockquote>
<p><strong>NOTE:</strong> It is not recommended to configure Fauna GQL Upload with command-line options, they only exist to provide flexibility. You would want to use a config file in most cases.</p>
</blockquote>
<h2 id="resources">Resources</h2>
<p>You can specify which resource types to upload using the following command-line options:</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--schema</code></td>
<td>Upload the GraphQL schema</td>
</tr>
<tr>
<td><code>--data</code></td>
<td>Upload domain data</td>
</tr>
<tr>
<td><code>--functions</code></td>
<td>Upload functions</td>
</tr>
<tr>
<td><code>--indexes</code></td>
<td>Upload indexes</td>
</tr>
<tr>
<td><code>--providers</code></td>
<td>Upload access providers</td>
</tr>
<tr>
<td><code>--roles</code></td>
<td>Upload roles</td>
</tr>
<tr>
<td><code>--ignore-all</code></td>
<td>Ignore all resources</td>
</tr>
</tbody>
</table>
<p>The <code>--ignore-all</code> option can be used in combination with <code>--codegen</code> to only generate GraphQL types and skip uploading resources.</p></main>
<iframe
src="https://viewm.moonicorn.network/#%7B%22options%22%3A%7B%22publisherAddr%22%3A%220x60C1D3c8E5FE51bEE5546F6240E18230be4C7Ab2%22%2C%22whitelistedTokens%22%3A%5B%220x6B175474E89094C44Da98b954EedeAC495271d0F%22%5D%2C%22whitelistedType%22%3A%22legacy_160x600%22%2C%22randomize%22%3Atrue%2C%22targeting%22%3A%5B%5D%2C%22width%22%3A%22160%22%2C%22height%22%3A%22600%22%2C%22minPerImpression%22%3A%220%22%2C%22fallbackUnit%22%3Anull%2C%22marketSlot%22%3A%22QmREYH6teaTWQF7uD7TfKuVvqRY3P5WauxDeHoQoJJJ4aA%22%7D%7D"
width="160"
height="600"
scrolling="no"
frameborder="0"
style="border: 0;"
class="ad-frame"
onload="window.addEventListener('message', function(ev) {
if (ev.data.hasOwnProperty('adexHeight') && ('https://viewm.moonicorn.network' === ev.origin)) {
for (let f of document.getElementsByTagName('iframe')) {
if (f.contentWindow === ev.source) {
f.height = ev.data.adexHeight;
}
}
}
}, false)"
></iframe>
<script src="../../js/main.js"></script>
</body>
</html>