0.0.1 • Published 2 months ago

@axinom/pg-grouped-attributes-plugin v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

PgGroupedAttributesPlugin

About

This package contains a plugin written for Postgraphile version 5.

When it's unnecessary to add one-to-one relationship but you still want create a group of attributes looks like an object type in GraphQL, this plugins comes to the rescue.

Let's say you have a table called posts with following columns.

idtitledescription

Then you want to have a group columns to add meta tags of the posts. You could add a one-to-one table or add the columns to the same table above like below.

idtitledescriptionog__titleog__descriptionog__imageog__url

Without the plugin, Postgraphile will generate the GraphQL schema like below.

query Query ($id: String!) {
    post (id: $id) {
        id
        title
        description
        ogTitle
        ogDescription
        ogImage
        ogUrl
    }
}

But with the plugin in place, you can have it like this.

query Query ($id: String!) {
    post (id: $id) {
        id
        title
        description
        og {
            title
            description
            image
            url
        }
    }
}
0.0.2-beta.6

2 months ago

0.0.2-beta.5

3 months ago

0.0.2-beta.4

5 months ago

0.0.2-beta.3

7 months ago

0.0.2-beta.2

7 months ago

0.0.2-beta.1

8 months ago

0.0.2-beta.0

8 months ago

0.0.1

8 months ago