Created
May 19, 2018 23:51
-
-
Save dupski/c86828a98e3cd5f35760ca6f86fd39c2 to your computer and use it in GitHub Desktop.
Create a GraphQL API in 5 minutes - demo data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export async function createDemoData() { | |
const user1 = ( | |
await modelManager.create(new User({ | |
full_name: 'Russell Briggs', | |
email: '[email protected]' | |
})) | |
).result; | |
const user2 = ( | |
await modelManager.create(new User({ | |
full_name: 'Lauren Smith', | |
email: '[email protected]' | |
})) | |
).result; | |
await modelManager.create(new Post({ | |
post_date: '2018-05-14', | |
body: 'This is a cool post created with RevJS', | |
user: user1 | |
})); | |
await modelManager.create(new Post({ | |
post_date: '2018-05-17', | |
body: 'Laurens First Post', | |
user: user2 | |
})); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment