0.2.5 • Published 4 years ago

graphile-meta-schema v0.2.5

Weekly downloads
28
License
SEE LICENSE IN LI...
Repository
github
Last release
4 years ago

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