wiretrack

    wiretrack

    1 year ago
    Hey all, I’m digging a bit deeper on Prefect’s architecture, but I couldn’t quite understand the role of the three graphql services (Hasura, GraphQL and Apollo). I though Hasura already provided an endpoint and the platform to build mutations on top of it. So why would the GraphQL be needed? And if it’s to provide the mutations, the GraphQL already provides an endpoint as well, why is Apollo needed? Probably just a dumb question, but my only experience with GraphQL was plugging Hasura on top of Postgres, so I’m a bit lost on why the server was structured that way. Any insights?
    Kevin Kho

    Kevin Kho

    1 year ago
    Hey @wiretrack, I’ll ask the team about this
    Michael Adkins

    Michael Adkins

    1 year ago
    Hi, Apollo provides a schema-stitching layer that combines both the Hasura and custom GraphQL schemas into a unified API. Hasura did not have custom mutations when we started using it so I don't know much about their functionality there. Right now, each tool is in a specialized niche. Hasura generates an API from Postgres and provides row-level object permissioning. Our GraphQL server builds custom mutations and queries on top Hasura. Apollo combines both schemas and provides some mechanisms for improving performance.
    wiretrack

    wiretrack

    1 year ago
    Thanks @Michael Adkins, yeah maybe Hasura Actions would be the equivalent to the GraphQL mutations, but I do think is fairly new to Hasura (I think it allows for custom mutations and for the controller to be managed on the backend, but I’ve never used it in production). Makes sense, I was just a bit lost when I saw the same interface for the GraphQL and Apollo services (the playground), but understood the logic, thanks.