graphile-meta-schema

graphile meta schema


Keywords
postgraphile, graphile, plugin, postgres, graphql, metaschema
License
ICU
Install
npm install graphile-meta-schema@0.2.5

Documentation

graphile-meta-schema Build Status

npm install graphile-meta-schema 

example query

query MetaQuery {
  _meta {
    tables {
      name
      fields {
        name
        type {
          name
        }
      }
      constraints {
        ... on MetaschemaForeignKeyConstraint {
          fields {
            name
          }
          refTable {
            name
            fields {
              name
            }
          }
          refFields {
            name
          }
        }

        ... on MetaschemaPrimaryKeyConstraint {
          __typename
          fields {
            name
            type {
              name
            }
          }
          name
        }

        ... on MetaschemaUniqueConstraint {
          __typename
          name
          fields {
            name
            type {
              name
            }
          }
        }
        ... on MetaschemaCheckConstraint {
          __typename
          name
          fields {
            name
            type {
              name
            }
          }
        }
      }
    }
  }
}

testing

createdb metaschema_example
psql metaschema_example < sql/test.sql
psql metaschema_example < sql/types.sql