Git Product home page Git Product logo

Comments (3)

bboure avatar bboure commented on July 30, 2024

@devmetal I ran into the same issue today.
The problem is indeed that the mappingTemplates template is an array of arrays and is not flattened by the emulator like it is by the appsync-plugin

Same problem occurs after implementing this: sid88in/serverless-appsync-plugin#216 for the datasources.

And also when using an object as datasources instead of an array:

datasources:
  dataName:
    type: type: AWS_LAMBDA

from aws-utils.

devmetal avatar devmetal commented on July 30, 2024

@bboure Thank you :) It will be great if we can use same modular structure in data sources as we used in mapping templates :) I think my pr will solve this in appsync emulator. Thank you for support, and thanks for this big improvement in appsync plugin i can't wait to try it :)

from aws-utils.

dirk39 avatar dirk39 commented on July 30, 2024

Hi guys, I'm facing with this problem right now. Code written by @devmetal solve the problem, but only if you call function loadConfiguration.js that flat the mappingTemplates property. If you receive a serverless configuration from outside (server.js [line: 44])

const createSchema = async ({
  serverless,
  schemaPath = null,
  pubsub,
  dynamodb,
} = {}) => {
  let serverlessConfig = {};
  let serverlessDirectory;
  if (typeof serverless === 'object') {
    serverlessConfig = serverless.service;
    serverlessDirectory = serverless.config.servicePath;
  }

You'll receive the same message: The "path" argument must be of type string. Received type undefined. I'm thinking to split the part that load configuration from file and move construction and flattening of structure into a new common function (e.g. normalizeConfiguration).

What do you think?

from aws-utils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.