Querying Tables & Views

GraphQLize generates GraphQL query types for all the tables and the views by default.

For a table and a view like below,

CREATE TABLE actor (
-- ...
);
CREATE VIEW customer_list
AS
-- ...

GraphQLize generates the following queryies

type QueryRoot {
actors: [Actor]!
customerLists: [CustomerList]!
# ...
}
schema {
query: QueryRoot
}

The query name generation follows the below convention.

camel-case(pluralize(table-or-view-name))

Sample Queries

query {
# Table Name: `actor`
actors {
# Column Name: `first_name`
firstName
# Column Name: `last_name`
lastName
}
}
query {
# View Name: `customer_list`
customerLists {
# Column Name: `name`
name
# Column Name: `zip code`
zipCode
}
}