/**
* 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 497 days ago
/**
* 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 500 days ago
import { Resource } from "https://deno.land/x/windmill@v1.85.0/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 628 days ago
import { Resource } from "https://deno.land/x/windmill@v1.70.1/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 663 days ago
import { Resource } from "https://deno.land/x/windmill@v1.55.0/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 731 days ago