<% // Test output in playground // https://ionicabizau.github.io/ejs-playground/ // Input variables // const configExtension = 'yml'; // const isSdk = true; // Inline variables const name = 'Trippin'; const handler = 'odata'; const batch = 'multipart'; const expandNavProps = true; const endpoint = 'https://services.odata.org/TripPinRESTierService/(S({env.NX__TRIPPIN__API_KEY}))/'; const browser = false; const fileRoot = './src/'; const documents = `${fileRoot}graphql/**/*.*.graphql`; if (configExtension === 'cjs' || configExtension ==='js') { -%> module.exports = { sources: [ { name: '<%= name %>', handler: { <%= handler %>: { endpoint: '<%= endpoint %>', batch: '<%= batch %>', expandNavProps: <%= expandNavProps %>, }, }, }, ], serve: { browser: <%= browser %>, }, documents: ['<%= documents %>'], }; <% } else if (configExtension === 'json') { -%> { "sources": [ { "name": "<%= name %>", "handler": { "<%= handler %>": { endpoint: "<%= endpoint %>", batch: "<%= batch %>", expandNavProps: <%= expandNavProps %> } } } ], "serve": { "browser": <%= browser %> }, "documents": ['<%= documents %>'] } <% } else if (configExtension === 'yml') { -%> sources: - name: <%= name %> handler: <%= handler %>: endpoint: <%= endpoint %> batch: <%= batch %> expandNavProps: <%= expandNavProps %> serve: browser: false documents: - <%= documents %> <% }-%>