Skip to content

benjie/codec-resource-v5-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demonstrates how to add a codec + resource to PostGraphile so that you can represent an arbitrary SQL expression as if it were any other table in your schema.

To use:

createdb harry
psql -X1v ON_ERROR_STOP=1 -f schema.sql harry
yarn start

See the plugin in graphile.config.mjs for details of adding the codec and resource.

Then issue a query such as:

{
  allBlogPosts {
    nodes {
      ctName
      entryId
      fieldName
      stringValue
      booleanValue
    }
  }
}

to see the data from your new "virtual table".

About

For Harry on Discord

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published