Skip to content
This repository has been archived by the owner on Sep 30, 2019. It is now read-only.

Assertions within createSchema method prevent DynamoDB from being null #169

Open
LMulvey opened this issue Sep 10, 2019 · 1 comment
Open

Comments

@LMulvey
Copy link

LMulvey commented Sep 10, 2019

03a2b20 added functionality for providing/overriding DynamoDB inside our configurations to be null, which allowed us to skip/opt-out of using the DynamoDB emulator when it was not required.

However, the assertions inside of the createSchema method (schema.js, line 395-396) prevent dynamodb and dynamodbTables from being fals-y and stop execution when they are:

  // These lines will throw if dynamodb/dynamodbTables are falsy
  assert(dynamodb, 'must pass dynamodb');
  assert(
    dynamodbTables && typeof dynamodbTables === 'object',
    'must pass dynamodbTables',
  );

I suspect this was done because the underlying generateResolvers functions additionally takes in the dynamodb and dynamodbTables values. It would be really nice to be able to disable running DynamoDB as our current project does not use it in any capacity and the emulator has been causing team-wide Java dependency rabbit holes needlessly.

Happy to work toward a PR if nobody has the capacity to attempt this right now.

@cbaron
Copy link
Contributor

cbaron commented Sep 11, 2019

@LMulvey -- I believe your assumptions are correct. I broke a couple of this with that commit.

#161 -- is another PR needed due to it.

I want to point out that AWS's Amplify project has now incorporated this package into their source code, so this emulator is deprecated.

However, if you want to put up a PR, I will help you get it landed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants