Edits history of script submission #264 for ' Import GraphQL schema (faunadb)'

  • deno
    /**
     * Learn more at
     * https://docs.fauna.com/fauna/current/api/graphql/endpoints#import
     */
    type Faunadb = {
      region: string;
      secret: string;
    };
    export async function main(
      auth: Faunadb,
      schema: string,
      mode: "merge" | "replace" | "override" = "merge",
    ) {
      const region = ["us", "eu"].includes(auth.region) ? auth.region : "";
      const response = await fetch(
        `https://graphql.${region}.fauna.com/import?mode=${mode}`,
        {
          method: "POST",
          headers: {
            Authorization: "Bearer " + auth.secret,
          },
          body: schema,
        },
      );
      return await response.text();
    }
    

    Submitted by hugo697 398 days ago

  • deno
    /**
     * Learn more at
     * https://docs.fauna.com/fauna/current/api/graphql/endpoints#import
     */
    type Faunadb = {
      region: string;
      secret: string;
    };
    export async function main(
      auth: Faunadb,
      schema: string,
      mode: "merge" | "replace" | "override" = "merge",
    ) {
      const region = ["us", "eu"].includes(auth.region) ? auth.region : "";
      const response = await fetch(
        `https://graphql.${region}.fauna.com/import?mode=${mode}`,
        {
          method: "POST",
          headers: {
            Authorization: "Bearer " + auth.secret,
          },
          body: schema,
        },
      );
      return await response.text();
    }
    

    Submitted by admin 1031 days ago

  • deno
    
    /**
     * Learn more at 
     * https://docs.fauna.com/fauna/current/api/graphql/endpoints#import
     */
    type Faunadb = {
      region: string;
      secret: string;
    };
    export async function main(
      auth: Faunadb,
      schema: string,
      mode: 'merge' | 'replace' | 'override' = 'merge'
    ) {
      const region = ['us', 'eu'].includes(auth.region) ? auth.region : '';
      const response = await fetch(`https://graphql.${region}.fauna.com/import?mode=${mode}`, {
        method: 'POST',
        headers: {
          Authorization: 'Bearer ' + auth.secret
        },
        body: schema
      });
      return await response.text();
    }
    

    Submitted by admin 1034 days ago

  • deno
    import { Resource } from "https://deno.land/x/[email protected]/mod.ts"
    
    /**
     * Learn more at 
     * https://docs.fauna.com/fauna/current/api/graphql/endpoints#import
     */
    export async function main(
      auth: Resource<'faunadb'>,
      schema: string,
      mode: 'merge' | 'replace' | 'override' = 'merge'
    ) {
      const region = ['us', 'eu'].includes(auth.region) ? auth.region : '';
      const response = await fetch(`https://graphql.${region}.fauna.com/import?mode=${mode}`, {
        method: 'POST',
        headers: {
          Authorization: 'Bearer ' + auth.secret
        },
        body: schema
      });
      return await response.text();
    }
    

    Submitted by adam186 1162 days ago

  • deno
    import { Resource } from "https://deno.land/x/[email protected]/mod.ts"
    
    /**
     * Learn more at 
     * https://docs.fauna.com/fauna/current/api/graphql/endpoints#import
     */
    export async function main(
      auth: Resource<'faunadb'>,
      schema: string,
      mode: 'merge' | 'replace' | 'override' = 'merge'
    ) {
      const region = ['us', 'eu'].includes(auth.region) ? auth.region : '';
      const response = await fetch(`https://graphql.${region}.fauna.com/import?mode=${mode}`, {
        method: 'POST',
        headers: {
          Authorization: 'Bearer ' + auth.secret
        },
        body: schema
      });
      return await response.text();
    }
    

    Submitted by adam186 1197 days ago

  • deno
    import { Resource } from "https://deno.land/x/[email protected]/mod.ts"
    
    /**
     * Learn more at 
     * https://docs.fauna.com/fauna/current/api/graphql/endpoints#import
     */
    export async function main(
      auth: Resource<'faunadb'>,
      schema: string,
      mode: 'merge' | 'replace' | 'override' = 'merge'
    ) {
      const region = ['us', 'eu'].includes(auth.region) ? auth.region : '';
      const response = await fetch(`https://graphql.${region}.fauna.com/import?mode=${mode}`, {
        method: 'POST',
        headers: {
          Authorization: 'Bearer ' + auth.secret
        },
        body: schema
      });
      return await response.text();
    }
    

    Submitted by adam186 1266 days ago