graphql-mesh icon indicating copy to clipboard operation
graphql-mesh copied to clipboard

Apache AGE handler?? Apache AGE is a PostgreSQL Extension that provides graph database functionality

Open xem-tim-duval opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

Yes, I tried using the Postgres handler and it doesn’t read anything from the database

The AGE extension is, I believe, how PG gets it’s ‘multi-modal’ status on db-engines.com. We were hoping to use it for a large project where we had both graph and relational needs and didn’t want to be proprietarily cornered (custom languages) or vendor affiliated.

After taking the extension for a spin via docker containers (server, viewer) , I found the following.

In addition to a custom schema created by the extension to manage the ‘graphs’, I found the Apache Incubator AGE extension creates a new ‘schema’ inside the default ‘postgres’ database when you create a graph. Neither of these are the default schema.

I didn’t see any documentation for postgraphile on how to specify the specific schema in the connection string (it tried ?defaultSchema=<schema_name>, nada…

The only content that comes up in the GraphQL browser on localhost:4000 are ‘Node’ and ‘NodeId’. I assume this is a base type template of sorts.

There is an AGViewer they offer (in a container) that allows you to write queries (very neo4j browser like). I’m assuming under the hood, they have the code that shows how to query and extract graphs from PG/AGE. Looks like they do through JDBC.

Using a relational means/mechanism to retrieve a graph seems counter-intuitive. It appears the AGE team is very focused on the hybridization of SQL and CYPHER queries, which is fine, and to them, providing this capability may be a way of giving the best of both worlds?

I just can’t see developing/selling a product saying it’s backend is multi-modal, got graph capabilities, but it is currently limited to accessing the graph remotely by relational means.

Describe the solution you'd like

AGE for PG is a great addition to an already awesome RDBMS. GraphQL Mesh’s ability to create a GraphQL API for the graph it allows us to manage may just be be the first (I believe) GraphQL API capability for the Apache AGE incubator project.

Describe alternatives you've considered

- Alternative 1: use the PG Handler for GraphQL Mesh
- Alternative 2: create an OpenAPI spec to crate REST service, but then that defeats the whole ‘graph’ thing, doesn’t it?? 
- Alternative 3: use JDBC the way the viewer does to query the graph relationally, then render another graph, client-side, from the relational data, …I’m already getting tired thinking of it…
- Alternative 4: reach out to my friends at the Guild and inquire on the art of the possible!

Additional context

Video demonstration of Apache AGE for Postgres’s capabilities

xem-tim-duval avatar Oct 10 '21 22:10 xem-tim-duval

We don't know much about Apache AGE. Maybe @benjie (Maintainer of the great Postgraphile project used by GraphQL Mesh) has an idea about why Postgraphile isn't reading the database coming from Apache AGE.

ardatan avatar Dec 28 '21 09:12 ardatan

By default we exclude resources from extensions because the vast majority of users don’t want them in their GraphQL schema; however you can tell us to include them with the includeExtensionResources: true option:

includeExtensionResources: By default, tables and functions that come from extensions are excluded from the generated GraphQL schema as general applications don't need them to be exposed to the end user. You can use this flag to include them in the generated schema (not recommended).

benjie avatar Dec 28 '21 10:12 benjie