Redwood: Using Existing GraphQL endpoint.

Created on 20 Aug 2020  路  6Comments  路  Source: redwoodjs/redwood

Is it possible to use Redwood with an already existing GraphQL endpoint or using a service such as Hasura or FaunaDB?

kinquestion web

Most helpful comment

They're currently working on a FaunaDB integration.

All 6 comments

They're currently working on a FaunaDB integration.

@brianraila It should be possible. In your redwood.toml, there's a variable you can set called apiProxyPath. If you look at how Redwood instantiates the Apollo Client, it uses __REDWOOD__API_PROXY_PATH as the uri.

https://github.com/redwoodjs/redwood/blob/352ab14a3e7ce67cdf119cf6580df4e7a2423df9/packages/web/src/graphql/index.js#L10-L15

__REDWOOD__API_PROXY_PATH is set using apiProxyPath in webpack.common.js, so you can kind of tweak your graphQL endpoint by changing apiProxyPath.

https://github.com/redwoodjs/redwood/blob/352ab14a3e7ce67cdf119cf6580df4e7a2423df9/packages/core/config/webpack.common.js#L136-L140

But right now that trailing /graphql is hardcoded in, so you'd have to go into node_modules if you want to change that too.

Hi @brianraila If you haven't seen these already, here are some relevant docs and conversations:

Hope this helps!

Closing this Issue for now. But (re)open as needed and/or reach out on the Forums!

Thanks for that @thedavidprice

But does this mean I am not able to take advantage of "cells" in Redwood when using an external GraphQL API?

@brianraila A Cell will still work just fine :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hemildesai picture hemildesai  路  4Comments

tmeasday picture tmeasday  路  4Comments

weaversam8 picture weaversam8  路  4Comments

weaversam8 picture weaversam8  路  3Comments

aldonline picture aldonline  路  3Comments