Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

GraphQL API server RFC #22

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

jgierer12
Copy link

@sedubois
Copy link

sedubois commented Dec 5, 2018

Great stuff! While Gatsby can be used for the web, it currently doesn’t offer a solution for native apps AFAIK (or does it?). If Gatsby’s data layer could be run as a backend it could help a lot. Not quite clear how authentication would be handled though.

Our app is available through web, iOS and Android so I’d be really excited to see this happening. We have a PostgreSQL database, so Gatsby could sit in front of it with gatsby-source-pg (or using Prisma, Hasura etc), alongside other sources stitched together by Gatsby, and the whole thing would be available to web, iOS and Android clients.

@jgierer12
Copy link
Author

Interesting, I haven't considered that use case yet, but it's certainly a huge one. I mainly focused on using the data in projects that are already static Gatsby apps.

I also haven't thought much about authentication yet, IMHO we should not implement any auth in the core api-server and let users configure it themselves via the JavaScript API if they need it. I believe a setup where the API is publicly accessible is enough for most use cases.

@jgierer12
Copy link
Author

Added new drawback:

Queries that are the same at build time and run time must be duplicated (example).

@jlengstorf
Copy link

@jgierer12 That seems solvable — if we see the query being used elsewhere, we could preserve it instead of removing it during the build. There might be some restrictions I'm not aware of, but I think we could definitely fix this without requiring duplicated queries.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants