Skip to content

Commit

Permalink
docs: DOCS
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Sep 2, 2024
1 parent 1000334 commit 7bef636
Show file tree
Hide file tree
Showing 23 changed files with 578 additions and 4 deletions.
545 changes: 545 additions & 0 deletions README.md

Large diffs are not rendered by default.

Binary file added docs/database-branch-create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/database-branches.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/database-bulk-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/database-select-many.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/database.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/factory-create-instances.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/factory-faker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/factory-toggle-location.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/factory.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/graphql-playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/history.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pubsub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/resolvers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/rest-playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/script.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/snapshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/app/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: {
enabled: true,
enabled: false,
},

ssr: false,
Expand Down
4 changes: 2 additions & 2 deletions packages/app/server/plugins/init.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createMoquerieInstance } from '@moquerie/core'
import { createMoquerieInstance, startServer } from '@moquerie/core'
import { getDefaultCwd } from '@moquerie/core/util'
import { setMq } from '../utils/instance.js'

Expand All @@ -8,5 +8,5 @@ export default defineNitroPlugin(async () => {
})
setMq(mq)
// Start server
await mq.getResolvedContext()
await startServer(mq)
})
5 changes: 5 additions & 0 deletions packages/moquerie/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# moquerie

> Effortlessly mock your entire API with simple configuration and a beautiful UI.
[Documentation](https://github.com/Akryum/moquerie)
24 changes: 24 additions & 0 deletions playground/mq-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { createInstanceFromFactory, createMoquerieInstance, getFactoryByName, getFactoryStorage, runScript, startServer } from 'moquerie'

const mq = await createMoquerieInstance({
cwd: process.cwd(),
watching: true,
skipWrites: false,
})

await startServer(mq)

const report = await runScript(mq, 'createSimpleMessage')
console.log(report)

const factory = await getFactoryByName(mq, 'SimpleMessage')
const instance = await createInstanceFromFactory(mq, {
factory,
save: true,
})

const ctx = await mq.getResolvedContext()
// You can even check for the tags
const me = await ctx.db.User.findFirstReference((data, { tags }) => tags.includes('me'))

await mq.destroy()
2 changes: 1 addition & 1 deletion playground/src/schema.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
}),

...defineApiRoutes((router) => {
router.get('/hello', async ({ db }) => {
router.get('/messages/count', async ({ db }) => {
return (await db.Message.findMany()).length
})
}),
Expand Down

0 comments on commit 7bef636

Please sign in to comment.