Skip to content

Commit 17297b8

Browse files
committed
preparations for extending this repo into the woo.sh repo (moved README.md into './graphql-api-generator/'
1 parent 65e9985 commit 17297b8

File tree

2 files changed

+71
-69
lines changed

2 files changed

+71
-69
lines changed

README.md

Lines changed: 2 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,2 @@
1-
# pgschema-to-apischema
2-
The tool in this repository extends a schema for Property Graphs into a GraphQL schema for a GraphQL API, where [the Property Graph schema is assumed to be represented using the GraphQL Schema Definition Language (SDL)](http://blog.liu.se/olafhartig/documents/graphql-schemas-for-property-graphs/). The actual approach to extend the Property Graph schemas into GraphQL API schemas (as implemented by this tool) is documented in the [wiki of this repo](https://github.com/LiUGraphQL/pgschema-to-apischema/wiki).
3-
4-
## Prerequisites
5-
```bash
6-
$ pip3 install graphql-core-next
7-
```
8-
9-
## Example
10-
```bash
11-
$ python3 generator.py \
12-
--input resources/schema.graphql \
13-
--output api-schema.graphql \
14-
--config resources/config.yml
15-
```
16-
17-
## Usage
18-
```bash
19-
$ python3 generator.py --help
20-
usage: generator.py [-h] --input INPUT [--output OUTPUT] [--config CONFIG]
21-
22-
optional arguments:
23-
-h, --help show this help message and exit
24-
--input INPUT Input schema files (separated by commas)
25-
--output OUTPUT Output schema file (default stdout)
26-
--config CONFIG Path to configuration file
27-
```
28-
29-
30-
## Configuration
31-
The configuration file controls the features that are enabled during the generation process. For example:
32-
```yaml
33-
transform:
34-
type_names: PascalCase
35-
field_names: camelCase
36-
enum_values: uppercase
37-
drop_comments: true
38-
generation:
39-
add_query_type: true
40-
add_mutation_type: true
41-
# add id field to all schema types
42-
field_for_id: true
43-
# add creation date and last update date field(s) to all schema types
44-
generate_datetime: false
45-
field_for_creation_date: true
46-
field_for_last_update_date: true
47-
# add reverse edges for traversal
48-
reverse_edges: true
49-
# add edge types
50-
edge_types: false
51-
fields_for_edge_types: false
52-
# add queries
53-
query_by_id: true
54-
query_list_of: true
55-
# add input types
56-
input_to_create_objects: true
57-
input_to_update_objects: true
58-
# add edge input types (not supported)
59-
input_to_create_edge_objects: false
60-
input_to_update_edge_objects: false
61-
# add mutations
62-
create_objects: true
63-
update_objects: true
64-
delete_objects: false
65-
# add edge mutations (not supported)
66-
create_edge_objects: false
67-
update_edge_objects: false
68-
delete_edge_objects: false
69-
```
1+
# woo.sh
2+
Framework for generating a GraphQL server backed by a database.

graphql-api-generator/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# pgschema-to-apischema
2+
The tool in this repository extends a schema for Property Graphs into a GraphQL schema for a GraphQL API, where [the Property Graph schema is assumed to be represented using the GraphQL Schema Definition Language (SDL)](http://blog.liu.se/olafhartig/documents/graphql-schemas-for-property-graphs/). The actual approach to extend the Property Graph schemas into GraphQL API schemas (as implemented by this tool) is documented in the [wiki of this repo](https://github.com/LiUGraphQL/pgschema-to-apischema/wiki).
3+
4+
## Prerequisites
5+
```bash
6+
$ pip3 install graphql-core-next
7+
```
8+
9+
## Example
10+
```bash
11+
$ python3 generator.py \
12+
--input resources/schema.graphql \
13+
--output api-schema.graphql \
14+
--config resources/config.yml
15+
```
16+
17+
## Usage
18+
```bash
19+
$ python3 generator.py --help
20+
usage: generator.py [-h] --input INPUT [--output OUTPUT] [--config CONFIG]
21+
22+
optional arguments:
23+
-h, --help show this help message and exit
24+
--input INPUT Input schema files (separated by commas)
25+
--output OUTPUT Output schema file (default stdout)
26+
--config CONFIG Path to configuration file
27+
```
28+
29+
30+
## Configuration
31+
The configuration file controls the features that are enabled during the generation process. For example:
32+
```yaml
33+
transform:
34+
type_names: PascalCase
35+
field_names: camelCase
36+
enum_values: uppercase
37+
drop_comments: true
38+
generation:
39+
add_query_type: true
40+
add_mutation_type: true
41+
# add id field to all schema types
42+
field_for_id: true
43+
# add creation date and last update date field(s) to all schema types
44+
generate_datetime: false
45+
field_for_creation_date: true
46+
field_for_last_update_date: true
47+
# add reverse edges for traversal
48+
reverse_edges: true
49+
# add edge types
50+
edge_types: false
51+
fields_for_edge_types: false
52+
# add queries
53+
query_by_id: true
54+
query_list_of: true
55+
# add input types
56+
input_to_create_objects: true
57+
input_to_update_objects: true
58+
# add edge input types (not supported)
59+
input_to_create_edge_objects: false
60+
input_to_update_edge_objects: false
61+
# add mutations
62+
create_objects: true
63+
update_objects: true
64+
delete_objects: false
65+
# add edge mutations (not supported)
66+
create_edge_objects: false
67+
update_edge_objects: false
68+
delete_edge_objects: false
69+
```

0 commit comments

Comments
 (0)