这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@dariocravero
Copy link
Contributor

Description

Add the ability to export a function in json2graphql as well as an object, so we can await on it.

What component does this PR affect?

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System

Requires changes from other components? If yes, please mark the components:

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System

Related Issue

#1488

Solution and Design

If you need to do some asynchronous stuff before exporting your data, you can also export a function:

module.exports = async function() {
  let db = {}

  // do asynchronous stuff

  return db
}

Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Docs update
  • Community content

Checklist:

  • I have read the contributing guide and my code conforms to the guidelines.
  • This change requires a change in the documentation.
  • I have updated the documentation accordingly.
  • I have added required tests.

@hasura-bot
Copy link
Contributor

Beep boop! 🤖

Hey @dariocravero, thanks for your PR!

One of my human friends will review this PR and get back to you as soon as possible. 🕐

Stay awesome! 😎

@hasura-bot
Copy link
Contributor

Review app for commit ca67b26 deployed to Heroku: https://hge-ci-pull-1543.herokuapp.com
Docker image for server: hasura/graphql-engine:pull1543-ca67b26

@arvi3411301 arvi3411301 merged commit 5739b75 into hasura:master Feb 1, 2019
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-1543.herokuapp.com is deleted

@hasura-bot
Copy link
Contributor

Beep boop! 🤖

Whoa! 🎉 🎉 💃

GIF

Awesome work @dariocravero! 💪 🏆 All of us at Hasura ❤️ what you did.

Thanks again 🤗

@wawhal wawhal changed the title feat: allow json2graphql db.js to export a function to do async stuff inside allow json2graphql db.js to export a function to do async stuff inside Feb 1, 2019
@wawhal wawhal added c/community Related to community content c/json2graphql k/enhancement New feature or improve an existing feature labels Feb 1, 2019
@dariocravero
Copy link
Contributor Author

dariocravero commented Feb 1, 2019 via email

hasura-bot pushed a commit that referenced this pull request Jan 27, 2025
<!-- The PR description should answer 2 important questions: -->

### What

This was added in #1540 by accident, Cargo ignores it, removing.

V3_GIT_ORIGIN_REV_ID: 06546990dc8fd72c57c4700b9d874cc3787c71c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/community Related to community content k/enhancement New feature or improve an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants