Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to seed certain data into appsync backed tables ? #462

Open
3 tasks done
BBopanna opened this issue Aug 15, 2022 · 1 comment
Open
3 tasks done

How to seed certain data into appsync backed tables ? #462

BBopanna opened this issue Aug 15, 2022 · 1 comment
Labels
feature-request New feature or request GraphQL

Comments

@BBopanna
Copy link

Before opening, please confirm:

JavaScript Framework

React

Amplify APIs

GraphQL API

Amplify Categories

auth, storage, api, hosting

Environment information

# Put output below this line

  System:
    OS: macOS 12.4
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 259.82 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.15.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 104.0.5112.79
    Safari: 15.5
  npmGlobalPackages:
    @aws-amplify/cli: 8.5.1
    corepack: 0.10.0
    npm: 8.15.0
    typescript: 4.7.4
    yarn: 1.22.19

npm notice
npm notice New minor version of npm available! 8.15.0 -> 8.17.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.17.0
npm notice Run npm install -g [email protected] to update!
npm notice

Describe the bug

We have a requirement that when we add a new amplify env we want certain data also known as seedData to be present in certains tables.

Example : Zipcode model backed table should have certain data when a new env is created or added - How can we achieve this without explicitly a cognito user creating it?

We could like for this data to be available for every new amplify env added begining with the dev env that amplify init creates

How can this be achieved ?

Expected behavior

Be able to seed default data into appsync model backed tables.

Reproduction steps

NA

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

@chrisbonifacio
Copy link
Member

chrisbonifacio commented Aug 16, 2022

Hi @BBopanna 👋 thanks for raising this issue. Unfortunately, this is not currently supported or available as a feature. The only seeding capabilities we currently offer are via Amplify Studio. However, this does not automatically happen on new environment creation and requires that DataStore be enabled on the GraphQL API. Unless you have offline data requirements, that may not be what you want or need.

For more information on that: https://docs.amplify.aws/console/tutorial/data/#create-data-model

I have labeled this as a feature request and made the data team aware of it for future consideration.

@stocaaro stocaaro transferred this issue from aws-amplify/amplify-js Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request GraphQL
Projects
None yet
Development

No branches or pull requests

2 participants