autographql 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- autographql-0.1.0/.gitignore +243 -0
- autographql-0.1.0/LICENSE +21 -0
- autographql-0.1.0/PKG-INFO +200 -0
- autographql-0.1.0/README.md +163 -0
- autographql-0.1.0/pyproject.toml +70 -0
- autographql-0.1.0/src/autographql/__init__.py +15 -0
- autographql-0.1.0/src/autographql/_version.py +24 -0
- autographql-0.1.0/src/autographql/cli.py +66 -0
- autographql-0.1.0/src/autographql/generators/__init__.py +1 -0
- autographql-0.1.0/src/autographql/generators/alias_generator.py +142 -0
- autographql-0.1.0/src/autographql/generators/base_generator.py +503 -0
- autographql-0.1.0/src/autographql/generators/basic_query_generator.py +35 -0
- autographql-0.1.0/src/autographql/generators/directive_generator.py +239 -0
- autographql-0.1.0/src/autographql/generators/external_fragments_generator.py +129 -0
- autographql-0.1.0/src/autographql/generators/filter_generator.py +171 -0
- autographql-0.1.0/src/autographql/generators/generator_factory.py +45 -0
- autographql-0.1.0/src/autographql/generators/inline_fragments_generator.py +113 -0
- autographql-0.1.0/src/autographql/generators/mutation_generator.py +291 -0
- autographql-0.1.0/src/autographql/generators/pagination_generator.py +298 -0
- autographql-0.1.0/src/autographql/query_generator_app.py +138 -0
- autographql-0.1.0/src/autographql/utils/__init__.py +1 -0
- autographql-0.1.0/src/autographql/utils/schema_utils.py +84 -0
- autographql-0.1.0/src/autographql/utils/variable_utils.py +205 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
*.lcov
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
.pybuilder/
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
88
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
89
|
+
# .python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
# Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# uv
|
|
99
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
100
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
101
|
+
# commonly ignored for libraries.
|
|
102
|
+
# uv.lock
|
|
103
|
+
|
|
104
|
+
# poetry
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
106
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
107
|
+
# commonly ignored for libraries.
|
|
108
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
109
|
+
# poetry.lock
|
|
110
|
+
# poetry.toml
|
|
111
|
+
|
|
112
|
+
# pdm
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
114
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
115
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
116
|
+
# pdm.lock
|
|
117
|
+
# pdm.toml
|
|
118
|
+
.pdm-python
|
|
119
|
+
.pdm-build/
|
|
120
|
+
|
|
121
|
+
# pixi
|
|
122
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
123
|
+
# pixi.lock
|
|
124
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
125
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
126
|
+
.pixi/*
|
|
127
|
+
!.pixi/config.toml
|
|
128
|
+
|
|
129
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
130
|
+
__pypackages__/
|
|
131
|
+
|
|
132
|
+
# Celery stuff
|
|
133
|
+
celerybeat-schedule*
|
|
134
|
+
celerybeat.pid
|
|
135
|
+
|
|
136
|
+
# Redis
|
|
137
|
+
*.rdb
|
|
138
|
+
*.aof
|
|
139
|
+
*.pid
|
|
140
|
+
|
|
141
|
+
# RabbitMQ
|
|
142
|
+
mnesia/
|
|
143
|
+
rabbitmq/
|
|
144
|
+
rabbitmq-data/
|
|
145
|
+
|
|
146
|
+
# ActiveMQ
|
|
147
|
+
activemq-data/
|
|
148
|
+
|
|
149
|
+
# SageMath parsed files
|
|
150
|
+
*.sage.py
|
|
151
|
+
|
|
152
|
+
# Environments
|
|
153
|
+
.env
|
|
154
|
+
.envrc
|
|
155
|
+
.venv
|
|
156
|
+
env/
|
|
157
|
+
venv/
|
|
158
|
+
ENV/
|
|
159
|
+
env.bak/
|
|
160
|
+
venv.bak/
|
|
161
|
+
|
|
162
|
+
# Spyder project settings
|
|
163
|
+
.spyderproject
|
|
164
|
+
.spyproject
|
|
165
|
+
|
|
166
|
+
# Rope project settings
|
|
167
|
+
.ropeproject
|
|
168
|
+
|
|
169
|
+
# mkdocs/Zensical documentation
|
|
170
|
+
/site
|
|
171
|
+
|
|
172
|
+
# mypy
|
|
173
|
+
.mypy_cache/
|
|
174
|
+
.dmypy.json
|
|
175
|
+
dmypy.json
|
|
176
|
+
|
|
177
|
+
# Pyre type checker
|
|
178
|
+
.pyre/
|
|
179
|
+
|
|
180
|
+
# pytype static type analyzer
|
|
181
|
+
.pytype/
|
|
182
|
+
|
|
183
|
+
# Cython debug symbols
|
|
184
|
+
cython_debug/
|
|
185
|
+
|
|
186
|
+
# PyCharm
|
|
187
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
188
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
189
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
190
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
191
|
+
# .idea/
|
|
192
|
+
|
|
193
|
+
# Abstra
|
|
194
|
+
# Abstra is an AI-powered process automation framework.
|
|
195
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
196
|
+
# Learn more at https://abstra.io/docs
|
|
197
|
+
.abstra/
|
|
198
|
+
|
|
199
|
+
# Visual Studio Code
|
|
200
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
|
|
201
|
+
# can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
202
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer, you
|
|
203
|
+
# could uncomment the following to ignore the entire vscode folder
|
|
204
|
+
# .vscode/
|
|
205
|
+
# Temporary file for partial code execution
|
|
206
|
+
tempCodeRunnerFile.py
|
|
207
|
+
|
|
208
|
+
# Ruff stuff:
|
|
209
|
+
.ruff_cache/
|
|
210
|
+
|
|
211
|
+
# PyPI configuration file
|
|
212
|
+
.pypirc
|
|
213
|
+
|
|
214
|
+
# Marimo
|
|
215
|
+
marimo/_static/
|
|
216
|
+
marimo/_lsp/
|
|
217
|
+
__marimo__/
|
|
218
|
+
|
|
219
|
+
# Streamlit
|
|
220
|
+
.streamlit/secrets.toml
|
|
221
|
+
|
|
222
|
+
# ---------------------------------------------------------------------------
|
|
223
|
+
# Project-specific
|
|
224
|
+
# ---------------------------------------------------------------------------
|
|
225
|
+
# Generated at build time by hatch-vcs from the git tag. Committing it makes the
|
|
226
|
+
# tree dirty after every build, and setuptools_scm then reports a .dev version
|
|
227
|
+
# instead of the tag.
|
|
228
|
+
src/autographql/_version.py
|
|
229
|
+
|
|
230
|
+
# CLI output: autographql-generate writes here by default.
|
|
231
|
+
generated_queries/
|
|
232
|
+
|
|
233
|
+
# Datasets live in https://github.com/nl2graphql-bench/datasets, not here.
|
|
234
|
+
*.jsonl
|
|
235
|
+
*.jsonl.gz
|
|
236
|
+
*.xlsx
|
|
237
|
+
|
|
238
|
+
# The 2,100-row hidden benchmark must never be committed anywhere, public or
|
|
239
|
+
# private: it is what leaderboard submissions are scored against.
|
|
240
|
+
secret_data.jsonl
|
|
241
|
+
secret_dataset*
|
|
242
|
+
secret_*
|
|
243
|
+
*hidden*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 NL2GraphQL Bench contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: autographql
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Schema-driven generation of NL2GraphQL datasets from a GraphQL schema
|
|
5
|
+
Project-URL: Homepage, https://nl2graphql-bench.github.io/
|
|
6
|
+
Project-URL: Repository, https://github.com/nl2graphql-bench/generation
|
|
7
|
+
Project-URL: Datasets, https://github.com/nl2graphql-bench/datasets
|
|
8
|
+
Project-URL: Issues, https://github.com/nl2graphql-bench/generation/issues
|
|
9
|
+
Author: Keya Battu, Parth Mehta, Harikrishnan Balagopal, Manish Kesarwani
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: benchmark,dataset-generation,graphql,nl2graphql,synthetic-data
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Requires-Python: >=3.9
|
|
24
|
+
Requires-Dist: graphql-core<3.3,>=3.2
|
|
25
|
+
Provides-Extra: datasets
|
|
26
|
+
Requires-Dist: openpyxl>=3.1; extra == 'datasets'
|
|
27
|
+
Requires-Dist: pandas>=2.0; extra == 'datasets'
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: build>=1.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest>=7; extra == 'dev'
|
|
31
|
+
Requires-Dist: twine>=5.0; extra == 'dev'
|
|
32
|
+
Provides-Extra: web
|
|
33
|
+
Requires-Dist: fastapi>=0.100; extra == 'web'
|
|
34
|
+
Requires-Dist: python-multipart>=0.0.6; extra == 'web'
|
|
35
|
+
Requires-Dist: uvicorn[standard]>=0.22; extra == 'web'
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
# AutoGraphQL
|
|
39
|
+
|
|
40
|
+
[](#)
|
|
41
|
+
|
|
42
|
+
AutoGraphQL is a systematic, schema-driven framework for synthesizing GraphQL query datasets directly from GraphQL SDL schemas. It supports a broad range of GraphQL constructs, including fragments, inline fragments, directives, filters, pagination, aliases, and mutations, enabling the automated creation of diverse, executable datasets for fine-tuning LLMs and adapting them to domain or enterprise-specific schemas.
|
|
43
|
+
|
|
44
|
+
Official implementation of our paper accepted at the **EMNLP 2026 Industry Track**.
|
|
45
|
+
|
|
46
|
+
**[Paper](docs/autographql.pdf) | [Leaderboard](https://nl2graphql-bench.github.io/) | [Datasets](https://github.com/nl2graphql-bench/datasets) | [Index](https://github.com/nl2graphql-bench/index)**
|
|
47
|
+
|
|
48
|
+
This is the **generation** component of NL2GraphQL Bench. The released
|
|
49
|
+
train and public-test splits it produced are in
|
|
50
|
+
[nl2graphql-bench/datasets](https://github.com/nl2graphql-bench/datasets);
|
|
51
|
+
[nl2graphql-bench/index](https://github.com/nl2graphql-bench/index) links
|
|
52
|
+
every component. Licensed MIT.
|
|
53
|
+
|
|
54
|
+
## At a Glance
|
|
55
|
+
|
|
56
|
+
- **17,621** NL2GraphQL instances
|
|
57
|
+
- **173** GraphQL schemas
|
|
58
|
+
- **7** query categories
|
|
59
|
+
- Schema-disjoint training, public-test, and hidden-test splits
|
|
60
|
+
- Automated schema and execution validation
|
|
61
|
+
- Support for complex GraphQL constructs
|
|
62
|
+
- Web interface for query generation and dataset creation
|
|
63
|
+
|
|
64
|
+
## Framework
|
|
65
|
+
|
|
66
|
+
AutoGraphQL takes a GraphQL SDL schema as input and systematically generates diverse GraphQL queries while enforcing schema validity and execution correctness. Generated queries can subsequently be paired with natural-language descriptions to construct NL2GraphQL datasets and evaluate language models.
|
|
67
|
+
|
|
68
|
+
<p align="center">
|
|
69
|
+
<img src="docs/figures/toolkit.png" alt="AutoGraphQL framework overview" width="900"/>
|
|
70
|
+
</p>
|
|
71
|
+
|
|
72
|
+
<p align="center">
|
|
73
|
+
<em>Figure 1. Overview of the AutoGraphQL framework.</em>
|
|
74
|
+
</p>
|
|
75
|
+
|
|
76
|
+
The framework consists of the following main stages:
|
|
77
|
+
|
|
78
|
+
1. **Schema Processing**: parses and analyzes the input GraphQL SDL schema.
|
|
79
|
+
2. **Query Generation**: synthesizes queries across multiple GraphQL constructs and query categories.
|
|
80
|
+
3. **Validation**: checks generated queries for schema validity and executable correctness.
|
|
81
|
+
4. **Deduplication**: removes structurally redundant queries.
|
|
82
|
+
5. **Dataset Construction**: organizes validated queries into datasets for downstream NL2GraphQL research.
|
|
83
|
+
|
|
84
|
+
## Repository Structure
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
autographql/
|
|
88
|
+
├── pyproject.toml # packaging: deps, extras, console script
|
|
89
|
+
├── src/autographql/ # the package
|
|
90
|
+
│ ├── query_generator_app.py # GraphQLQueryGeneratorApp, the entry API
|
|
91
|
+
│ ├── cli.py # autographql-generate
|
|
92
|
+
│ ├── generators/ # one generator per query category
|
|
93
|
+
│ └── utils/ # schema introspection, variable generation
|
|
94
|
+
├── schemas/ # GraphQL schemas used for generation
|
|
95
|
+
├── docs/
|
|
96
|
+
│ ├── autographql.pdf # Paper
|
|
97
|
+
│ └── figures/
|
|
98
|
+
│ └── toolkit.png # Framework overview
|
|
99
|
+
└── website/ # Dataset Generator and Dataset Explorer UI
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## The interactive UI
|
|
103
|
+
|
|
104
|
+
`website/` is a FastAPI backend and a Next.js frontend serving two views:
|
|
105
|
+
|
|
106
|
+
- **Dataset Generator** — pick or upload `.graphql` schemas, choose categories,
|
|
107
|
+
queries per category and max hops, then generate. Each query is validated
|
|
108
|
+
against the schema and by executing it, and deduplicated by canonical hash.
|
|
109
|
+
- **Dataset Explorer** — browse what came out by split, schema and category, and
|
|
110
|
+
inspect the natural-language utterance, the query, its variables and the
|
|
111
|
+
schema side by side.
|
|
112
|
+
|
|
113
|
+
This is where validation happens: it is part of this framework rather than a
|
|
114
|
+
separate component.
|
|
115
|
+
|
|
116
|
+
## Install
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
pip install -e .
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Add extras as needed: `.[datasets]` to write xlsx, `.[web]` for the UI,
|
|
123
|
+
`.[dev]` for the build and test tools.
|
|
124
|
+
|
|
125
|
+
## Use as a library
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
from autographql import GraphQLQueryGeneratorApp
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Generate from the command line
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
autographql-generate --schema schemas/academic/index.graphql \
|
|
135
|
+
--category aliases --count 10 --max-hops 2
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
`--category` takes any of aliases, directives, external_fragments,
|
|
139
|
+
inline_fragments, filters, pagination, mutations, or `all`. Output is written to
|
|
140
|
+
`generated_queries/<schema>/`.
|
|
141
|
+
|
|
142
|
+
## Running the UI locally
|
|
143
|
+
|
|
144
|
+
### Backend
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
python3 -m venv venv
|
|
148
|
+
source venv/bin/activate
|
|
149
|
+
pip install -e ".[web,datasets]"
|
|
150
|
+
uvicorn website.backend.main:app --reload --port 8000
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Frontend
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
cd website/frontend
|
|
157
|
+
npm install
|
|
158
|
+
npm run dev
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Open `http://localhost:3000`.
|
|
162
|
+
|
|
163
|
+
### CLI
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
source venv/bin/activate
|
|
167
|
+
autographql-generate --schema schemas/academic/index.graphql --category all --count 5
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Datasets
|
|
171
|
+
|
|
172
|
+
The training corpus (9118 NL2GraphQL instances) and the schema-disjoint public benchmark test set (6403 instances) are available for download at`datasets/`.
|
|
173
|
+
|
|
174
|
+
## Citation
|
|
175
|
+
|
|
176
|
+
Please cite the repo if you think our work is helpful to you.
|
|
177
|
+
|
|
178
|
+
```bibtex
|
|
179
|
+
@inproceedings{autographql2026,
|
|
180
|
+
title={},
|
|
181
|
+
author={},
|
|
182
|
+
booktitle={},
|
|
183
|
+
year={2026}
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## License
|
|
188
|
+
|
|
189
|
+
MIT License
|
|
190
|
+
|
|
191
|
+
## Publishing
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
pip install build twine
|
|
195
|
+
python -m build
|
|
196
|
+
twine check dist/*
|
|
197
|
+
twine upload dist/*
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Version lives in `pyproject.toml` and `src/autographql/__init__.py`; bump both.
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# AutoGraphQL
|
|
2
|
+
|
|
3
|
+
[](#)
|
|
4
|
+
|
|
5
|
+
AutoGraphQL is a systematic, schema-driven framework for synthesizing GraphQL query datasets directly from GraphQL SDL schemas. It supports a broad range of GraphQL constructs, including fragments, inline fragments, directives, filters, pagination, aliases, and mutations, enabling the automated creation of diverse, executable datasets for fine-tuning LLMs and adapting them to domain or enterprise-specific schemas.
|
|
6
|
+
|
|
7
|
+
Official implementation of our paper accepted at the **EMNLP 2026 Industry Track**.
|
|
8
|
+
|
|
9
|
+
**[Paper](docs/autographql.pdf) | [Leaderboard](https://nl2graphql-bench.github.io/) | [Datasets](https://github.com/nl2graphql-bench/datasets) | [Index](https://github.com/nl2graphql-bench/index)**
|
|
10
|
+
|
|
11
|
+
This is the **generation** component of NL2GraphQL Bench. The released
|
|
12
|
+
train and public-test splits it produced are in
|
|
13
|
+
[nl2graphql-bench/datasets](https://github.com/nl2graphql-bench/datasets);
|
|
14
|
+
[nl2graphql-bench/index](https://github.com/nl2graphql-bench/index) links
|
|
15
|
+
every component. Licensed MIT.
|
|
16
|
+
|
|
17
|
+
## At a Glance
|
|
18
|
+
|
|
19
|
+
- **17,621** NL2GraphQL instances
|
|
20
|
+
- **173** GraphQL schemas
|
|
21
|
+
- **7** query categories
|
|
22
|
+
- Schema-disjoint training, public-test, and hidden-test splits
|
|
23
|
+
- Automated schema and execution validation
|
|
24
|
+
- Support for complex GraphQL constructs
|
|
25
|
+
- Web interface for query generation and dataset creation
|
|
26
|
+
|
|
27
|
+
## Framework
|
|
28
|
+
|
|
29
|
+
AutoGraphQL takes a GraphQL SDL schema as input and systematically generates diverse GraphQL queries while enforcing schema validity and execution correctness. Generated queries can subsequently be paired with natural-language descriptions to construct NL2GraphQL datasets and evaluate language models.
|
|
30
|
+
|
|
31
|
+
<p align="center">
|
|
32
|
+
<img src="docs/figures/toolkit.png" alt="AutoGraphQL framework overview" width="900"/>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<em>Figure 1. Overview of the AutoGraphQL framework.</em>
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
The framework consists of the following main stages:
|
|
40
|
+
|
|
41
|
+
1. **Schema Processing**: parses and analyzes the input GraphQL SDL schema.
|
|
42
|
+
2. **Query Generation**: synthesizes queries across multiple GraphQL constructs and query categories.
|
|
43
|
+
3. **Validation**: checks generated queries for schema validity and executable correctness.
|
|
44
|
+
4. **Deduplication**: removes structurally redundant queries.
|
|
45
|
+
5. **Dataset Construction**: organizes validated queries into datasets for downstream NL2GraphQL research.
|
|
46
|
+
|
|
47
|
+
## Repository Structure
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
autographql/
|
|
51
|
+
├── pyproject.toml # packaging: deps, extras, console script
|
|
52
|
+
├── src/autographql/ # the package
|
|
53
|
+
│ ├── query_generator_app.py # GraphQLQueryGeneratorApp, the entry API
|
|
54
|
+
│ ├── cli.py # autographql-generate
|
|
55
|
+
│ ├── generators/ # one generator per query category
|
|
56
|
+
│ └── utils/ # schema introspection, variable generation
|
|
57
|
+
├── schemas/ # GraphQL schemas used for generation
|
|
58
|
+
├── docs/
|
|
59
|
+
│ ├── autographql.pdf # Paper
|
|
60
|
+
│ └── figures/
|
|
61
|
+
│ └── toolkit.png # Framework overview
|
|
62
|
+
└── website/ # Dataset Generator and Dataset Explorer UI
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## The interactive UI
|
|
66
|
+
|
|
67
|
+
`website/` is a FastAPI backend and a Next.js frontend serving two views:
|
|
68
|
+
|
|
69
|
+
- **Dataset Generator** — pick or upload `.graphql` schemas, choose categories,
|
|
70
|
+
queries per category and max hops, then generate. Each query is validated
|
|
71
|
+
against the schema and by executing it, and deduplicated by canonical hash.
|
|
72
|
+
- **Dataset Explorer** — browse what came out by split, schema and category, and
|
|
73
|
+
inspect the natural-language utterance, the query, its variables and the
|
|
74
|
+
schema side by side.
|
|
75
|
+
|
|
76
|
+
This is where validation happens: it is part of this framework rather than a
|
|
77
|
+
separate component.
|
|
78
|
+
|
|
79
|
+
## Install
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
pip install -e .
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Add extras as needed: `.[datasets]` to write xlsx, `.[web]` for the UI,
|
|
86
|
+
`.[dev]` for the build and test tools.
|
|
87
|
+
|
|
88
|
+
## Use as a library
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
from autographql import GraphQLQueryGeneratorApp
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Generate from the command line
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
autographql-generate --schema schemas/academic/index.graphql \
|
|
98
|
+
--category aliases --count 10 --max-hops 2
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`--category` takes any of aliases, directives, external_fragments,
|
|
102
|
+
inline_fragments, filters, pagination, mutations, or `all`. Output is written to
|
|
103
|
+
`generated_queries/<schema>/`.
|
|
104
|
+
|
|
105
|
+
## Running the UI locally
|
|
106
|
+
|
|
107
|
+
### Backend
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
python3 -m venv venv
|
|
111
|
+
source venv/bin/activate
|
|
112
|
+
pip install -e ".[web,datasets]"
|
|
113
|
+
uvicorn website.backend.main:app --reload --port 8000
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Frontend
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
cd website/frontend
|
|
120
|
+
npm install
|
|
121
|
+
npm run dev
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Open `http://localhost:3000`.
|
|
125
|
+
|
|
126
|
+
### CLI
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
source venv/bin/activate
|
|
130
|
+
autographql-generate --schema schemas/academic/index.graphql --category all --count 5
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Datasets
|
|
134
|
+
|
|
135
|
+
The training corpus (9118 NL2GraphQL instances) and the schema-disjoint public benchmark test set (6403 instances) are available for download at`datasets/`.
|
|
136
|
+
|
|
137
|
+
## Citation
|
|
138
|
+
|
|
139
|
+
Please cite the repo if you think our work is helpful to you.
|
|
140
|
+
|
|
141
|
+
```bibtex
|
|
142
|
+
@inproceedings{autographql2026,
|
|
143
|
+
title={},
|
|
144
|
+
author={},
|
|
145
|
+
booktitle={},
|
|
146
|
+
year={2026}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## License
|
|
151
|
+
|
|
152
|
+
MIT License
|
|
153
|
+
|
|
154
|
+
## Publishing
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
pip install build twine
|
|
158
|
+
python -m build
|
|
159
|
+
twine check dist/*
|
|
160
|
+
twine upload dist/*
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Version lives in `pyproject.toml` and `src/autographql/__init__.py`; bump both.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.21", "hatch-vcs>=0.4"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "autographql"
|
|
7
|
+
# Version comes from the git tag via hatch-vcs, so a release cannot publish a
|
|
8
|
+
# number that disagrees with the tag it was cut from. Do not hardcode it here.
|
|
9
|
+
dynamic = ["version"]
|
|
10
|
+
description = "Schema-driven generation of NL2GraphQL datasets from a GraphQL schema"
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
requires-python = ">=3.9"
|
|
13
|
+
license = "MIT"
|
|
14
|
+
license-files = ["LICENSE"]
|
|
15
|
+
authors = [
|
|
16
|
+
{ name = "Keya Battu" },
|
|
17
|
+
{ name = "Parth Mehta" },
|
|
18
|
+
{ name = "Harikrishnan Balagopal" },
|
|
19
|
+
{ name = "Manish Kesarwani" },
|
|
20
|
+
]
|
|
21
|
+
keywords = ["graphql", "nl2graphql", "dataset-generation", "synthetic-data", "benchmark"]
|
|
22
|
+
classifiers = [
|
|
23
|
+
"Development Status :: 4 - Beta",
|
|
24
|
+
"Intended Audience :: Science/Research",
|
|
25
|
+
"License :: OSI Approved :: MIT License",
|
|
26
|
+
"Programming Language :: Python :: 3",
|
|
27
|
+
"Programming Language :: Python :: 3.9",
|
|
28
|
+
"Programming Language :: Python :: 3.10",
|
|
29
|
+
"Programming Language :: Python :: 3.11",
|
|
30
|
+
"Programming Language :: Python :: 3.12",
|
|
31
|
+
"Programming Language :: Python :: 3.13",
|
|
32
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
33
|
+
]
|
|
34
|
+
dependencies = [
|
|
35
|
+
# Schema parsing and query construction. Pinned below 3.3: from 3.3 a node's
|
|
36
|
+
# `directives` is None when absent where 3.2 returned [], which breaks AST
|
|
37
|
+
# walking shared with the evaluation package.
|
|
38
|
+
"graphql-core>=3.2,<3.3",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
[project.optional-dependencies]
|
|
42
|
+
# Writing generated datasets to xlsx.
|
|
43
|
+
datasets = ["pandas>=2.0", "openpyxl>=3.1"]
|
|
44
|
+
# The Dataset Generator and Dataset Explorer UI under website/.
|
|
45
|
+
web = ["fastapi>=0.100", "uvicorn[standard]>=0.22", "python-multipart>=0.0.6"]
|
|
46
|
+
dev = ["pytest>=7", "build>=1.0", "twine>=5.0"]
|
|
47
|
+
|
|
48
|
+
[project.urls]
|
|
49
|
+
Homepage = "https://nl2graphql-bench.github.io/"
|
|
50
|
+
Repository = "https://github.com/nl2graphql-bench/generation"
|
|
51
|
+
Datasets = "https://github.com/nl2graphql-bench/datasets"
|
|
52
|
+
Issues = "https://github.com/nl2graphql-bench/generation/issues"
|
|
53
|
+
|
|
54
|
+
[project.scripts]
|
|
55
|
+
autographql-generate = "autographql.cli:main"
|
|
56
|
+
|
|
57
|
+
[tool.hatch.version]
|
|
58
|
+
source = "vcs"
|
|
59
|
+
# Tags are v-prefixed: v0.1.0 -> 0.1.0
|
|
60
|
+
tag-pattern = "v(?P<version>.+)"
|
|
61
|
+
|
|
62
|
+
[tool.hatch.build.hooks.vcs]
|
|
63
|
+
# Generated at build time; the package reads its version from here.
|
|
64
|
+
version-file = "src/autographql/_version.py"
|
|
65
|
+
|
|
66
|
+
[tool.hatch.build.targets.wheel]
|
|
67
|
+
packages = ["src/autographql"]
|
|
68
|
+
|
|
69
|
+
[tool.hatch.build.targets.sdist]
|
|
70
|
+
include = ["src/autographql", "README.md", "LICENSE", "pyproject.toml"]
|