UNPKG

fauna-gql-upload

Version:

Manage your FaunaDB resources in within your project and upload them using a single command

349 lines (287 loc) 10.4 kB
<!DOCTYPE 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>Config file - 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 class="active"> <a href="./">Config file</a> </li> <li > <a href="../command-line-options/">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="config-file">Config file</h1> <p>If you need to customize paths or set a different environment variable name for your secret key, you can create a configuration file called <code>.fauna.json</code> in your project root. The name of this file can be customized using the <code>--config</code> command-line option (see <a href="/configuration/command-line-options">Command-line options</a> for more info).</p> <p>It takes the following properties:</p> <table> <thead> <tr> <th>Property</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>schemaPath</code></td> <td><code>fauna/schema.gql</code></td> <td>Path to your GraphQL schema.</td> </tr> <tr> <td><code>secretEnv</code></td> <td><code>FGU_SECRET</code></td> <td>The key used to access your FaunaDB database.</td> </tr> <tr> <td><code>region</code></td> <td>Whichever endpoint works with the provided secret</td> <td>Specify the region group that your database belongs to. Possible values are: <code>eu</code>, <code>us</code>, <code>classic</code>, <code>preview</code> and <code>local</code>.</td> </tr> <tr> <td><code>mode</code></td> <td><code>merge</code></td> <td>Specify the schema upload mode. Possible values are: <code>merge</code>, <code>override</code> and <code>replace</code></td> </tr> <tr> <td><code>apiEndpointEnv</code></td> <td><code>FGU_API_ENDPOINT</code></td> <td>Environment variable for custom api endpoint, useful for local development</td> </tr> <tr> <td><code>graphqlEndpointEnv</code></td> <td><code>FGU_GRAPHQL_ENDPOINT</code></td> <td>Environment variable for custom graphql endpoint, useful for local development</td> </tr> <tr> <td><code>tsconfigPath</code></td> <td><code>tsconfig.json</code></td> <td>Path to a <code>tsconfig.json</code> file.</td> </tr> <tr> <td><code>envPath</code></td> <td><code>.env</code></td> <td>Path to the environment file that holds your <code>secretEnv</code></td> </tr> <tr> <td><code>fnsDir</code></td> <td><code>fauna/functions</code></td> <td>Path to directory that holds your FQL UDFs.</td> </tr> <tr> <td><code>indexesDir</code></td> <td><code>fauna/indexes</code></td> <td>Path to directory that holds your FaunaDB indexes</td> </tr> <tr> <td><code>rolesDir</code></td> <td><code>fauna/roles</code></td> <td>Path to directory that holds your FaunaDB roles</td> </tr> <tr> <td><code>dataDir</code></td> <td><code>fauna/data</code></td> <td>Path to directory that holds your domain data.</td> </tr> <tr> <td><code>providersDir</code></td> <td><code>fauna/providers</code></td> <td>Path to directory that holds your access providers.</td> </tr> <tr> <td><code>codegen</code></td> <td><code>null</code></td> <td>Whether or not to generate code based on your GraphQL schema. Takes either a <strong>boolean</strong> or an <strong>object</strong></td> </tr> <tr> <td><code>codegen.plugins</code></td> <td><code>[]</code></td> <td>Any plugins you want to use with GraphQL codegen</td> </tr> <tr> <td><code>codegen.pluginOptions</code></td> <td><code>{}</code></td> <td>Plugin options to apply to all plugins</td> </tr> <tr> <td><code>codegen.documents</code></td> <td><code>[]</code></td> <td>Array of file paths, relative to the project root, to read queries, mutations, and subscriptions from</td> </tr> <tr> <td><code>codegen.outputFile</code></td> <td><code>generated/graphql.ts</code></td> <td>File that the generated GraphQL types and operations will be written to</td> </tr> <tr> <td><code>codegen.headers</code></td> <td><code>{}</code></td> <td>Any additional headers you want to include. This is usually used with preview features such as <code>x-schema-preview: partial-update-mutation</code>. Your secret is automatically added, so no need to include it here.</td> </tr> <tr> <td><code>codegen.operations</code></td> <td><code>true</code></td> <td>Whether or not to enable the <code>typescript-operations</code> plugin.</td> </tr> <tr> <td><code>codegen.typescript</code></td> <td><code>true</code></td> <td>Whether or not to enable the <code>typescript</code> plugin. Setting this to false will change your <code>outputFile</code> to use a <code>.js</code> extension, unless you've set a custom <code>outputFile</code> and won't generate types.</td> </tr> </tbody> </table> <p><em>All properties are optional, you can omit <code>.fauna.json</code> completely if you are happy with the defaults.</em></p> <h2 id="region">Region</h2> <p>The <code>region</code> option controls your GraphQL endpoint. The table below shows what endpoints the different options correspond to:</p> <table> <thead> <tr> <th>Option</th> <th>Endpoint</th> </tr> </thead> <tbody> <tr> <td><code>eu</code></td> <td><code>https://graphql.eu.fauna.com</code></td> </tr> <tr> <td><code>us</code></td> <td><code>https://graphql.us.fauna.com</code></td> </tr> <tr> <td><code>classic</code></td> <td><code>https://graphql.fauna.com</code></td> </tr> <tr> <td><code>preview</code></td> <td><code>https://graphql.fauna-preview.com</code></td> </tr> <tr> <td><code>local</code></td> <td><code>http://localhost:8084</code></td> </tr> </tbody> </table> <p>For greater control over your GraphQL endpoint, ie. when using a non-standard development endpoint, use the <code>FGU_GQL_ENDPOINT</code> environment variable.</p> <p>The <code>region</code> option is actually completely optional. If you do not specify it, Fauna GQL Upload will try every known endpoint with your provided secret key and use first endpoint that doesn't give a <code>"Invalid database secret"</code> error.</p> <p>Despite this, it is recommended to set the region whenever possible.</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>