diff --git a/function-connector-sources/graphql/_resource.json b/function-connector-sources/graphql/_resource.json new file mode 100644 index 0000000..9e7d14f --- /dev/null +++ b/function-connector-sources/graphql/_resource.json @@ -0,0 +1,4 @@ +{ + "$id": "graphql", + "$schema": "https://schema.yext.com/config/platform/plugin/v1" +} \ No newline at end of file diff --git a/function-connector-sources/graphql/mod.ts b/function-connector-sources/graphql/mod.ts new file mode 100755 index 0000000..06cafd5 --- /dev/null +++ b/function-connector-sources/graphql/mod.ts @@ -0,0 +1,7 @@ +export async function fetchGraphQLAPI (graphQLUrl: string) { + const graphQLResponse = await fetch(graphQLUrl).then(response => response.json()); + + const response = { data: graphQLResponse.data }; + + return JSON.stringify(response); +}