graphql-idl-parser 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -1
- data/Rakefile +6 -4
- data/ext/graphql-idl-parser/graphql-idl-parser/Cargo.lock +295 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/Cargo.toml +16 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/LICENSE.txt +21 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/README.md +53 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/build.rs +5 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/Cargo.lock +305 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/Cargo.toml +18 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/README.md +48 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/example/example.c +33 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/includes/gql-idl-parser.h +138 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/src/lib.rs +128 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/src/types.rs +485 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-1d630313aa5d216c/build-script-build +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-1d630313aa5d216c/build_script_build-1d630313aa5d216c +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-3e27951e7158def5/build-script-build +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-3e27951e7158def5/build_script_build-3e27951e7158def5 +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-481c4176d6a6472d/output +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-481c4176d6a6472d/stderr +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-5e9a4656cd081ee1/output +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/graphql-idl-parser-5e9a4656cd081ee1/stderr +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/kernel32-sys-2b7eb293aa6c1ae8/output +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/kernel32-sys-2b7eb293aa6c1ae8/stderr +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/kernel32-sys-da175f6bc66f228c/build-script-build +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/kernel32-sys-da175f6bc66f228c/build_script_build-da175f6bc66f228c +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/lalrpop-d0f0dc8a044bb86f/build-script-build +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/lalrpop-d0f0dc8a044bb86f/build_script_build-d0f0dc8a044bb86f +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/lalrpop-db9b482018d6c515/output +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/build/lalrpop-db9b482018d6c515/stderr +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libaho_corasick-07ac37ff1c5ebb39.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libascii_canvas-37ba58d788f6e28b.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libatty-3d34ead0eff1f49c.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libbit_set-05034a00bed6372c.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libbit_vec-ba66b7b721a96204.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libbuild-d4f96a70b883038d.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libdiff-9cac472257fa481b.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libdocopt-5b3087b1b6e5d091.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libeither-8157fecd348c1485.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libena-b40ce2cd268672c3.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libfixedbitset-c7f65ed08cebcf3b.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libgraphql_idl_parser-38237266b2814db0.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libgraphql_idl_parser-85dc5bc4abe95968.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libgraphqlidlparser.dylib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libitertools-8d570d6c59d3b2d0.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libkernel32-fa4855bd85e0519b.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblalrpop-8888f5942735b084.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblalrpop_intern-70b4cf4d149e3995.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblalrpop_snap-695e4827988eac78.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblalrpop_util-90bdd1a9fd691a70.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblazy_static-a6b1325db7ee41a1.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/liblibc-0d055c7503ac4180.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libmemchr-7e8d0bb06e3caae0.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libordermap-f92645c599568d9f.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libpetgraph-62c5b51f9db3f0c7.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libregex-5d259a9431f27ed9.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libregex_syntax-e6a16469e776d773.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/librustc_serialize-21d20a12dd90991b.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libstrsim-8e26967d29bdf2e6.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libterm-189de8985c74cf03.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libthread_local-036458f1fbee14fb.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libunicode_xid-8adffabb9e6dd184.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libunreachable-bd47b36c4e87f432.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libutf8_ranges-220e9d44a3644657.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libvoid-d761da60d30362e9.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/deps/libwinapi-753252e15931e6fc.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/libgraphqlidlparser.d +1 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/target/release/libgraphqlidlparser.dylib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar.c +673 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar.h +161 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar/fixtures.h +54 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar/fs.h +341 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar/print.h +74 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar/sandbox.h +154 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/clar_test.h +19 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/enums.c +40 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/generate.py +243 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/helpers.c +60 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/helpers.h +6 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/input_objects.c +48 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/interfaces.c +41 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/main.c +35 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/objects.c +130 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/scalars.c +39 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/graphql-idl-parser-ffi/test/unions.c +38 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/script/compile +11 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/script/fmt +23 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/script/test +30 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/src/gqlidl.lalrpop +199 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/src/gqlidl.rs +29491 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/src/lib.rs +9 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/src/macros.rs +61 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/src/tests.rs +561 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/src/type_definition.rs +404 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0ed64d9cad312f79/output +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0ed64d9cad312f79/stderr +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0fa24f7f5e35d20a/build-script-build +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0fa24f7f5e35d20a/build_script_build-0fa24f7f5e35d20a +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0fa24f7f5e35d20a/build_script_build-0fa24f7f5e35d20a.dSYM/Contents/Info.plist +20 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-0fa24f7f5e35d20a/build_script_build-0fa24f7f5e35d20a.dSYM/Contents/Resources/DWARF/build_script_build-0fa24f7f5e35d20a +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-57f7e3c3ef8471d2/build-script-build +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-57f7e3c3ef8471d2/build_script_build-57f7e3c3ef8471d2 +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-57f7e3c3ef8471d2/build_script_build-57f7e3c3ef8471d2.dSYM/Contents/Info.plist +20 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-57f7e3c3ef8471d2/build_script_build-57f7e3c3ef8471d2.dSYM/Contents/Resources/DWARF/build_script_build-57f7e3c3ef8471d2 +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-5e9a4656cd081ee1/output +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/graphql-idl-parser-5e9a4656cd081ee1/stderr +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-2b7eb293aa6c1ae8/output +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-2b7eb293aa6c1ae8/stderr +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-d2306aba19864163/build-script-build +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-d2306aba19864163/build_script_build-d2306aba19864163 +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-d2306aba19864163/build_script_build-d2306aba19864163.dSYM/Contents/Info.plist +20 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/kernel32-sys-d2306aba19864163/build_script_build-d2306aba19864163.dSYM/Contents/Resources/DWARF/build_script_build-d2306aba19864163 +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-4a05302baa5fb2a2/build-script-build +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-4a05302baa5fb2a2/build_script_build-4a05302baa5fb2a2 +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-4a05302baa5fb2a2/build_script_build-4a05302baa5fb2a2.dSYM/Contents/Info.plist +20 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-4a05302baa5fb2a2/build_script_build-4a05302baa5fb2a2.dSYM/Contents/Resources/DWARF/build_script_build-4a05302baa5fb2a2 +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-db9b482018d6c515/output +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/build/lalrpop-db9b482018d6c515/stderr +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libaho_corasick-a9ec1f95080d1f6a.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libascii_canvas-92c3bf0cf98f6d67.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libatty-35b65e46cfc403bc.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libbit_set-d9484919f1726cf1.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libbit_vec-8716b059e7c4619b.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libbuild-0b12b372edd4cd19.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libdiff-c81afd03f1d10610.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libdocopt-f02dfd6fea4878cc.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libeither-20b79fd67623dec7.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libena-e8706d9d37da725b.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libfixedbitset-da616d0027237c90.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libgraphql_idl_parser-33a4c3bdcdc654b7.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libgraphql_idl_parser-d6636cf90a34aa47.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libitertools-34d50068529acf4d.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libkernel32-56b5a11a7716f7c7.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblalrpop-65f3c84608c05ce1.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblalrpop_intern-a3c97188386c0872.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblalrpop_snap-d6e467def27f0a55.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblalrpop_util-e59e6b2e2aec1b3e.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblazy_static-4518bdaa60b81936.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/liblibc-ab7be4fcfaa3a31b.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libmemchr-85dd561868acc188.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libordermap-4691b832eea88398.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libpetgraph-0220c5a13678d70e.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libregex-44e22d9874a5fb64.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libregex_syntax-490c2654111b5bf0.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/librustc_serialize-a7771718d4ee73a5.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libstrsim-038156debd12bd7a.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libterm-d12b955648e4f4b4.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libthread_local-84091b6b04cf1914.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libunicode_xid-89ce822c6e6dbe69.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libunreachable-654322b1fcb434b1.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libutf8_ranges-53f91d3b6e8885c9.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libvoid-181e881e54467554.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/deps/libwinapi-9c9d2aba65add76c.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/target/debug/libgraphql_idl_parser.rlib +0 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/test/enums.graphql +8 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/test/github.graphql +5115 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/test/input_objects.graphql +11 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/test/interfaces.graphql +5 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/test/objects.graphql +54 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/test/scalars.graphql +4 -0
- data/ext/graphql-idl-parser/graphql-idl-parser/test/unions.graphql +2 -0
- data/graphql-idl-parser.gemspec +8 -6
- data/lib/graphql-idl-parser/version.rb +1 -1
- data/test/graphql-idl-parser/enums_test.rb +20 -0
- data/test/graphql-idl-parser/graphql-idl-parser_test.rb +48 -0
- data/test/graphql-idl-parser/input_objects_test.rb +28 -0
- data/test/graphql-idl-parser/interfaces_test.rb +20 -0
- data/test/graphql-idl-parser/objects_test.rb +104 -0
- data/test/graphql-idl-parser/scalars_test.rb +19 -0
- data/test/graphql-idl-parser/unions_test.rb +18 -0
- data/test/test_helper.rb +12 -0
- metadata +194 -12
- data/.gitignore +0 -18
- data/.gitmodules +0 -4
- data/.rubocop.yml +0 -10
- data/.travis.yml +0 -28
- data/Gemfile +0 -4
- data/script/bootstrap +0 -11
- data/script/cibuild +0 -5
- data/script/update_submodules +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 297058a97c6df60b8f47cd316176d9a534350837
|
4
|
+
data.tar.gz: 84616a13b8d756d9458795fa4fd887eb920d184e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfdede9884384d310e4199c65f2da1e6f12b8b138b268c711a4625a5f62b10e5f3c189d187941714c0b6bff51c1b50dbcb7fd094e1c7781b93e398d277c73bb1
|
7
|
+
data.tar.gz: '053484ccf493e50bc7aa2a5dabbdf9964b1cfb381e6d0d732379621db037d6b0ff87433fce3dee7e282b01da3110a63965c83b7ddfb922fe2f7216f7a00d6f42'
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ Or install it yourself as:
|
|
25
25
|
|
26
26
|
``` ruby
|
27
27
|
# feed it a file
|
28
|
-
parser = GraphQL::IDLParser.new(filename:
|
28
|
+
parser = GraphQL::IDLParser.new(filename: filename)
|
29
29
|
|
30
30
|
# or feed it a string
|
31
31
|
parser = GraphQL::IDLParser.new(schema: contents)
|
@@ -33,3 +33,20 @@ parser = GraphQL::IDLParser.new(schema: contents)
|
|
33
33
|
# execute!
|
34
34
|
results = parser.process
|
35
35
|
```
|
36
|
+
|
37
|
+
## Benchmarks
|
38
|
+
|
39
|
+
Check it out with `bundle exec rake benchmark`:
|
40
|
+
|
41
|
+
```
|
42
|
+
Warming up --------------------------------------
|
43
|
+
pure ruby 1.000 i/100ms
|
44
|
+
this gem 7.000 i/100ms
|
45
|
+
Calculating -------------------------------------
|
46
|
+
pure ruby 6.527 (± 0.0%) i/s - 33.000 in 5.082540s
|
47
|
+
this gem 73.511 (± 5.4%) i/s - 371.000 in 5.064868s
|
48
|
+
|
49
|
+
Comparison:
|
50
|
+
this gem : 73.5 i/s
|
51
|
+
pure ruby: 6.5 i/s - 11.26x slower
|
52
|
+
```
|
data/Rakefile
CHANGED
@@ -27,13 +27,15 @@ end
|
|
27
27
|
|
28
28
|
desc 'Benchmark loading an IDL file'
|
29
29
|
task :benchmark do
|
30
|
-
require 'benchmark'
|
30
|
+
require 'benchmark/ips'
|
31
31
|
require 'graphql'
|
32
32
|
require 'graphql-idl-parser'
|
33
33
|
|
34
|
-
|
34
|
+
filename = File.join('ext', 'graphql-idl-parser', 'graphql-idl-parser', 'test', 'github.graphql')
|
35
35
|
|
36
|
-
Benchmark.
|
37
|
-
x.report('
|
36
|
+
Benchmark.ips do |x|
|
37
|
+
x.report('pure ruby') { GraphQL.parse_file(filename) }
|
38
|
+
x.report('this gem ') { parser = GraphQL::IDLParser.new(filename: filename); parser.process }
|
39
|
+
x.compare!
|
38
40
|
end
|
39
41
|
end
|
@@ -0,0 +1,295 @@
|
|
1
|
+
[root]
|
2
|
+
name = "graphql-idl-parser"
|
3
|
+
version = "0.1.1"
|
4
|
+
dependencies = [
|
5
|
+
"lalrpop 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
6
|
+
"lalrpop-util 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
7
|
+
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
8
|
+
]
|
9
|
+
|
10
|
+
[[package]]
|
11
|
+
name = "aho-corasick"
|
12
|
+
version = "0.6.3"
|
13
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
14
|
+
dependencies = [
|
15
|
+
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
16
|
+
]
|
17
|
+
|
18
|
+
[[package]]
|
19
|
+
name = "ascii-canvas"
|
20
|
+
version = "1.0.0"
|
21
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
22
|
+
dependencies = [
|
23
|
+
"term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
24
|
+
]
|
25
|
+
|
26
|
+
[[package]]
|
27
|
+
name = "atty"
|
28
|
+
version = "0.1.2"
|
29
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
30
|
+
dependencies = [
|
31
|
+
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
32
|
+
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
33
|
+
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
34
|
+
]
|
35
|
+
|
36
|
+
[[package]]
|
37
|
+
name = "bit-set"
|
38
|
+
version = "0.4.0"
|
39
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
40
|
+
dependencies = [
|
41
|
+
"bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
42
|
+
]
|
43
|
+
|
44
|
+
[[package]]
|
45
|
+
name = "bit-vec"
|
46
|
+
version = "0.4.4"
|
47
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
48
|
+
|
49
|
+
[[package]]
|
50
|
+
name = "diff"
|
51
|
+
version = "0.1.10"
|
52
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
53
|
+
|
54
|
+
[[package]]
|
55
|
+
name = "docopt"
|
56
|
+
version = "0.7.0"
|
57
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
58
|
+
dependencies = [
|
59
|
+
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
60
|
+
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
61
|
+
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
62
|
+
"strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
63
|
+
]
|
64
|
+
|
65
|
+
[[package]]
|
66
|
+
name = "either"
|
67
|
+
version = "1.1.0"
|
68
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
69
|
+
|
70
|
+
[[package]]
|
71
|
+
name = "ena"
|
72
|
+
version = "0.5.0"
|
73
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
74
|
+
|
75
|
+
[[package]]
|
76
|
+
name = "fixedbitset"
|
77
|
+
version = "0.1.6"
|
78
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
79
|
+
|
80
|
+
[[package]]
|
81
|
+
name = "itertools"
|
82
|
+
version = "0.5.10"
|
83
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
84
|
+
dependencies = [
|
85
|
+
"either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
86
|
+
]
|
87
|
+
|
88
|
+
[[package]]
|
89
|
+
name = "kernel32-sys"
|
90
|
+
version = "0.2.2"
|
91
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
92
|
+
dependencies = [
|
93
|
+
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
94
|
+
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
95
|
+
]
|
96
|
+
|
97
|
+
[[package]]
|
98
|
+
name = "lalrpop"
|
99
|
+
version = "0.13.1"
|
100
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
101
|
+
dependencies = [
|
102
|
+
"ascii-canvas 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
103
|
+
"atty 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
104
|
+
"bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
105
|
+
"diff 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
106
|
+
"docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
107
|
+
"ena 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
108
|
+
"itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
109
|
+
"lalrpop-intern 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
110
|
+
"lalrpop-snap 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
111
|
+
"lalrpop-util 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
112
|
+
"petgraph 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
113
|
+
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
114
|
+
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
115
|
+
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
116
|
+
"term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
117
|
+
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
118
|
+
]
|
119
|
+
|
120
|
+
[[package]]
|
121
|
+
name = "lalrpop-intern"
|
122
|
+
version = "0.13.1"
|
123
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
124
|
+
|
125
|
+
[[package]]
|
126
|
+
name = "lalrpop-snap"
|
127
|
+
version = "0.13.1"
|
128
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
129
|
+
dependencies = [
|
130
|
+
"ascii-canvas 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
131
|
+
"atty 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
132
|
+
"bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
133
|
+
"diff 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
134
|
+
"docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
135
|
+
"ena 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
136
|
+
"itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
137
|
+
"lalrpop-intern 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
138
|
+
"lalrpop-util 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
139
|
+
"petgraph 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
140
|
+
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
141
|
+
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
142
|
+
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
143
|
+
"term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
144
|
+
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
145
|
+
]
|
146
|
+
|
147
|
+
[[package]]
|
148
|
+
name = "lalrpop-util"
|
149
|
+
version = "0.13.1"
|
150
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
151
|
+
|
152
|
+
[[package]]
|
153
|
+
name = "lazy_static"
|
154
|
+
version = "0.2.8"
|
155
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
156
|
+
|
157
|
+
[[package]]
|
158
|
+
name = "libc"
|
159
|
+
version = "0.2.24"
|
160
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
161
|
+
|
162
|
+
[[package]]
|
163
|
+
name = "memchr"
|
164
|
+
version = "1.0.1"
|
165
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
166
|
+
dependencies = [
|
167
|
+
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
168
|
+
]
|
169
|
+
|
170
|
+
[[package]]
|
171
|
+
name = "ordermap"
|
172
|
+
version = "0.2.10"
|
173
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
174
|
+
|
175
|
+
[[package]]
|
176
|
+
name = "petgraph"
|
177
|
+
version = "0.4.5"
|
178
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
179
|
+
dependencies = [
|
180
|
+
"fixedbitset 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
181
|
+
"ordermap 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
182
|
+
]
|
183
|
+
|
184
|
+
[[package]]
|
185
|
+
name = "regex"
|
186
|
+
version = "0.2.2"
|
187
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
188
|
+
dependencies = [
|
189
|
+
"aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
190
|
+
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
191
|
+
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
192
|
+
"thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
193
|
+
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
194
|
+
]
|
195
|
+
|
196
|
+
[[package]]
|
197
|
+
name = "regex-syntax"
|
198
|
+
version = "0.4.1"
|
199
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
200
|
+
|
201
|
+
[[package]]
|
202
|
+
name = "rustc-serialize"
|
203
|
+
version = "0.3.24"
|
204
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
205
|
+
|
206
|
+
[[package]]
|
207
|
+
name = "strsim"
|
208
|
+
version = "0.6.0"
|
209
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
210
|
+
|
211
|
+
[[package]]
|
212
|
+
name = "term"
|
213
|
+
version = "0.4.6"
|
214
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
215
|
+
dependencies = [
|
216
|
+
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
217
|
+
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
218
|
+
]
|
219
|
+
|
220
|
+
[[package]]
|
221
|
+
name = "thread_local"
|
222
|
+
version = "0.3.4"
|
223
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
224
|
+
dependencies = [
|
225
|
+
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
226
|
+
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
227
|
+
]
|
228
|
+
|
229
|
+
[[package]]
|
230
|
+
name = "unicode-xid"
|
231
|
+
version = "0.0.4"
|
232
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
233
|
+
|
234
|
+
[[package]]
|
235
|
+
name = "unreachable"
|
236
|
+
version = "1.0.0"
|
237
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
238
|
+
dependencies = [
|
239
|
+
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
240
|
+
]
|
241
|
+
|
242
|
+
[[package]]
|
243
|
+
name = "utf8-ranges"
|
244
|
+
version = "1.0.0"
|
245
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
246
|
+
|
247
|
+
[[package]]
|
248
|
+
name = "void"
|
249
|
+
version = "1.0.2"
|
250
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
251
|
+
|
252
|
+
[[package]]
|
253
|
+
name = "winapi"
|
254
|
+
version = "0.2.8"
|
255
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
256
|
+
|
257
|
+
[[package]]
|
258
|
+
name = "winapi-build"
|
259
|
+
version = "0.1.1"
|
260
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
261
|
+
|
262
|
+
[metadata]
|
263
|
+
"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699"
|
264
|
+
"checksum ascii-canvas 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b385d69402821a1c254533a011a312531cbcc0e3e24f19bbb4747a5a2daf37e2"
|
265
|
+
"checksum atty 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d0fd4c0631f06448cc45a6bbb3b710ebb7ff8ccb96a0800c994afe23a70d5df2"
|
266
|
+
"checksum bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c"
|
267
|
+
"checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f"
|
268
|
+
"checksum diff 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0a515461b6c8c08419850ced27bc29e86166dcdcde8fbe76f8b1f0589bb49472"
|
269
|
+
"checksum docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab32ea6e284d87987066f21a9e809a73c14720571ef34516f0890b3d355ccfd8"
|
270
|
+
"checksum either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18785c1ba806c258137c937e44ada9ee7e69a37e3c72077542cd2f069d78562a"
|
271
|
+
"checksum ena 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cabe5a5078ac8c506d3e4430763b1ba9b609b1286913e7d08e581d1c2de9b7e5"
|
272
|
+
"checksum fixedbitset 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fcf4412e2d11115c5ed81c2fbdaba8028de0c92553497aa771fc5f4e0c5c8793"
|
273
|
+
"checksum itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4833d6978da405305126af4ac88569b5d71ff758581ce5a987dbfa3755f694fc"
|
274
|
+
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
|
275
|
+
"checksum lalrpop 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8ebe5a5c90d5edeecb7f62f6ebec0a3d0f6faf4759a052708348cda99fd311a0"
|
276
|
+
"checksum lalrpop-intern 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05410c1e4aff497bdea1ccb274ac35536fda0ee858600df36966502d4f7acbe3"
|
277
|
+
"checksum lalrpop-snap 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f866ece35287f5223a1a022c5d86417c260cda2ca9c8a156af9959404ce5313"
|
278
|
+
"checksum lalrpop-util 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7c7743f235fc17f5f50f3b1e64a8690ee154f17f86bd68cbb78787c5b37907f7"
|
279
|
+
"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf"
|
280
|
+
"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc"
|
281
|
+
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4"
|
282
|
+
"checksum ordermap 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "c036a53e6bb62d7eee2edf7e087df56fd84c7bbae6a0bd93c2b9f54bddf62e03"
|
283
|
+
"checksum petgraph 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "14c6ae5ccb73b438781abc93d35615019b1ad6e24b44116377fb819cfd7587de"
|
284
|
+
"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b"
|
285
|
+
"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db"
|
286
|
+
"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
|
287
|
+
"checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694"
|
288
|
+
"checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1"
|
289
|
+
"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14"
|
290
|
+
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
|
291
|
+
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
|
292
|
+
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"
|
293
|
+
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
|
294
|
+
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
|
295
|
+
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
[package]
|
2
|
+
name = "graphql-idl-parser"
|
3
|
+
version = "0.1.1"
|
4
|
+
authors = ["Garen Torikian <gjtorikian@gmail.com>"]
|
5
|
+
build = "build.rs"
|
6
|
+
description = "A parser for the GraphQL IDL format."
|
7
|
+
license = "MIT"
|
8
|
+
repository = "https://github.com/gjtorikian/graphql-idl-parser"
|
9
|
+
categories = ["text-processing"]
|
10
|
+
|
11
|
+
[build-dependencies]
|
12
|
+
lalrpop = "0.13.0"
|
13
|
+
|
14
|
+
[dependencies]
|
15
|
+
lalrpop-util = "0.13.0"
|
16
|
+
regex = "0.2.1"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2017 Garen Torikian
|
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,53 @@
|
|
1
|
+
# graphql-idl-parser
|
2
|
+
|
3
|
+
A parser for GraphQL IDL files! This repository contains the code for both the Rust implementation,
|
4
|
+
as well as the FFI dylib implementation, which allows you to generate a library for use in C projects
|
5
|
+
(and other languages that play nice with C). See https://github.com/gjtorikian/graphql-idl-parser-ruby
|
6
|
+
for a Ruby implementation!
|
7
|
+
|
8
|
+
[![Build Status](https://travis-ci.org/gjtorikian/graphql-idl-parser.svg?branch=master)](https://travis-ci.org/gjtorikian/graphql-idl-parser)
|
9
|
+
|
10
|
+
## Why?
|
11
|
+
|
12
|
+
Two reasons:
|
13
|
+
|
14
|
+
* I have plenty of experience doing Bison/LALR grammars in C, and I desperately wanted to learn some Rust.
|
15
|
+
* Most of the GraphQL tooling, I'm sorry to say, appears to be in JavaScript. While that's cool, I
|
16
|
+
really believe that when it comes to creating a tool ecosystem, base implementations ought to be in
|
17
|
+
a language that can be consumed by other projects. In other words, the world doesn't need different GraphQL
|
18
|
+
IDL parsers in Node, and Ruby, and Python, and Java, and Scala. The base format should be in something
|
19
|
+
like C/C++/Rust, and then those higher level languages ought to make use of that one foundational library.
|
20
|
+
This ensures consistency and correctness, no matter what your backend is written in.
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
Add this to your `Cargo.toml`:
|
25
|
+
|
26
|
+
``` toml
|
27
|
+
[dependencies]
|
28
|
+
graphql-idl-parser = "^0.1"
|
29
|
+
```
|
30
|
+
|
31
|
+
and this to your crate root:
|
32
|
+
|
33
|
+
``` rust
|
34
|
+
extern crate graphql_idl_parser;
|
35
|
+
```
|
36
|
+
|
37
|
+
After that, simply feed in a GraphQL IDL string to `gqlidl::parse_schema`, like:
|
38
|
+
|
39
|
+
``` rust
|
40
|
+
let definitions = gqlidl::parse_schema(contents.as_str()).unwrap();
|
41
|
+
for def in definitions {
|
42
|
+
// ...
|
43
|
+
}
|
44
|
+
```
|
45
|
+
|
46
|
+
Note that this library does _not_ validate the format if your IDL. If you have multiple types with
|
47
|
+
the same name, for example, they will be happily consumed as unique types. However, the parser will
|
48
|
+
become irate if it comes across a malformed or unknown token.
|
49
|
+
|
50
|
+
## Todo:
|
51
|
+
|
52
|
+
- [ ] More documentation?
|
53
|
+
- [ ] Support more of the IDL besides just types
|