Best way to migrate from a graphql database running on top of MongoDB?

Hi,
so happy that you’ve decided to use Dgraph. I’m here to help.

You generally want to do an upsert. But upserts in GraphQL is Hard. If it’s a one-off, you might do with some custom DQL. I can show you how too.

The general process (in GraphQL) looks like this:

  1. create the Members without the Concepts. This is doable because you have no ! in your concepts field.
  2. For each member, use updateMember to add concepts

Let’s get you over to the dark side! We have cookies.

2 Likes