<% // Test output in playground // https://ionicabizau.github.io/ejs-playground/ // Input variables // const configExtension = 'yml'; // const isSdk = true; // Inline variables const name = 'StarWarsApi'; const handler = 'graphql' const source = 'https://swapi-graphql.netlify.app/.netlify/functions/index'; const browser = false; const fileRoot = './src/'; const documents = `${fileRoot}graphql/**/*.*.graphql`; if (configExtension === 'cjs' || configExtension ==='js') { -%> module.exports = { sources: [ { name: '<%= name %>', handler: { <%= handler %>: { endpoint: '<%= source %>', }, }, }, ], serve: { browser: <%= browser %>, }, documents: ['<%= documents %>'], }; <% } else if (configExtension === 'json') { -%> { "sources": [ { "name": "<%= name %>", "handler": { "<%= handler %>": { "endpoint": "<%= source %>" } } } ], "serve": { "browser": <%= browser %> }, "documents": ['<%= documents %>'] } <% } else if (configExtension === 'yml') { -%> sources: - name: <%= name %> handler: <%= handler %>: endpoint: <%= source %> serve: browser: false documents: - <%= documents %> <% }-%>