Absinthe: Feature Request: Mocking

Created on 28 Jun 2016  路  2Comments  路  Source: absinthe-graphql/absinthe

For building front-end apps, it would be great if there was an easy way to return fake data. This way people could already use the "API", while things haven't been implemented on the server-side yet.

There's a node.js project for building GraphQL apps in the works, Apollo. They managed to do this, and it seems to be a nice feature. See Mocking your server with just one line of code.

What do you think?

Most helpful comment

While I think this is certainly a useful idea (and we use Apollo Client at CargoSense, btw), I don't think this belongs _in_ Absinthe:

  • It's easy enough to define your own resolvers that can return mocked data (or even the default resolver) based on environment or other factors
  • If something like this was built to provide nice and easy semantics, it would belong in a separate package of utilities, just as it's part of graphql-tools for Apollo.

We certainly welcome help in building a wider ecosystem around Absinthe, and would love to work with people to make Absinthe more extensible for tools like this.

All 2 comments

While I think this is certainly a useful idea (and we use Apollo Client at CargoSense, btw), I don't think this belongs _in_ Absinthe:

  • It's easy enough to define your own resolvers that can return mocked data (or even the default resolver) based on environment or other factors
  • If something like this was built to provide nice and easy semantics, it would belong in a separate package of utilities, just as it's part of graphql-tools for Apollo.

We certainly welcome help in building a wider ecosystem around Absinthe, and would love to work with people to make Absinthe more extensible for tools like this.

Hi @bruce,
thanks for your feedback! To be honest I've never used Absinthe, as I'm still learning Elixir/ Phoenix, but this is something I'd love to have and I'll see if I can find an easy way once I get there :-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

scf4 picture scf4  路  3Comments

natecox picture natecox  路  6Comments

jfrolich picture jfrolich  路  5Comments

fbjork picture fbjork  路  5Comments

boxxxie picture boxxxie  路  5Comments