graphile / gatsby-source-pg

PostgreSQL source for Gatsby, powered by PostGraphile
36 stars 15 forks source link

Migrating from JSON to Postgres + gatsby-source-pg #25

Closed snussik closed 3 years ago

snussik commented 3 years ago

I'm trying to migrate from JSON file sourse to postgresql. And faced some issues with gatsby-source-pg:

  1. under_score was replaced to camelCase. Can this option be turned off in config?
  2. plugins, like @gatsby-contrib/gatsby-plugin-elasticlunr-search and gatsby's onCreateNode widely use nodes attribytes (eg. node.internal.type, resolver names). But plugin gives only PostGraphile_NAME type of node element whish is not suitable for that purposes. How it can be fixed?
benjie commented 3 years ago

under_score was replaced to camelCase. Can this option be turned off in config?

You can override it by overriding the relevant inflector: https://www.graphile.org/postgraphile/inflection/

plugins, like @gatsby-contrib/gatsby-plugin-elasticlunr-search and gatsby's onCreateNode widely use nodes attribytes (eg. node.internal.type, resolver names). But plugin gives only PostGraphile_NAME type of node element whish is not suitable for that purposes. How it can be fixed?

I don't follow; but if the issue exists in https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-graphql then your issue is better directed there since this plugin just wraps that plugin.

[semi-automated message] Thanks for your question; hopefully we're well on the way to helping you solve your issue. This doesn't currently seem to be a bug in the library so I'm going to close the issue, but please feel free to keep requesting help below and if it does turn out to be a bug we can definitely re-open it 👍

You can also ask for help in the #help-and-support channel in our Discord chat.