Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL Support #503

Merged
merged 121 commits into from
Sep 20, 2018
Merged

SDL Support #503

merged 121 commits into from
Sep 20, 2018

Conversation

benwilson512
Copy link
Contributor

@benwilson512 benwilson512 commented Feb 17, 2018

  • Absinthe.Schema.Notation => Blueprint Tree
  • SDL schema => Blueprint Tree
  • Blueprint Tree => compiled / usable schema

This branch is wildly experimental right now, do not try to use.

@benwilson512
Copy link
Contributor Author

benwilson512 commented Feb 19, 2018

Unfortunately, the current implementation has the compilation time issue we ran into with early versions of Absinthe. The experimental implementation does lots of the following, for every object and field

@absinthe_blueprint Notation.put_attrs(@absinthe_blueprint, ...)

For ~200 line schemas it takes ~2 seconds to compile. Not great, but workable. The problem is it's non linear. A schema twice the size at ~400 lines takes 12 seconds to compile. 700 lines takes 26 seconds, and 1000 lines takes 45 seconds.

Basically, we can't do stuff in the module body. This may be OK though, since we're doing things differently this time. If we ignore the problem of anonymous functions for a second (I've got an idea for those) I think we can simply push values into an ets table. Then we do a single @absinthe_blueprint with the blob at the bottom.

EDIT: 1000 line file reduced to 0.5 seconds. Got an approach that works.

@benwilson512 benwilson512 deleted the blueprint-schema-notation branch February 28, 2018 20:16
@benwilson512 benwilson512 restored the blueprint-schema-notation branch February 28, 2018 20:16
@benwilson512 benwilson512 reopened this Feb 28, 2018
This reverts commit dd01c7a.
* Add modify/1 hook, move pipeline, tweak tests

* formatting and use type references properly

* green simple test

* Support schema decoration

* Use decorations/2

* Add :resolve decoration

* Fix test name

* Add schema compilation error checking to pipeline

* Move SourceLocation from Blueprint.Document to Blueprint

* Remove unused module attribute

* Add :source_location to Blueprint.Schema structs, support in Draft

* Split Type.built_in_module?/1

We're already Module.split/1'ing, so we can use
Module.concat/1 vs Module.safe_concat/1.

* Add module tracking to InputValueDefinition

* Set identifier for InputValueDefinition

* InputValueDefinition -> Type.Argument w/ desc

* Track modules for enum values

* Fix test breakage due to code fix

* Use stuttering pre-walk, test describing args

* Remove module attribute debris

* formatting

* middleware renaming

* green tests

* use middleware_ref consistently

* don't do it for nil  refs

* add back in the struct attrs for functions

* move the functions back into the types

* unify middleware expansion

* handle functions more generically, and inline them when possible

* break out building the types from compiling them

* improved function inlining

* remove warning
@benwilson512
Copy link
Contributor Author

benwilson512 commented Sep 19, 2018

The only remaining functionality item at this point I think is

  • Subscription triggers

Then of course there's all the validation rules we need to recreate, and the error system.

@benwilson512
Copy link
Contributor Author

OK. I'm gonna merge this in at this point, everything is fully functional. The error system still needs to happen, but I'll handle that in another PR. The next major task is actually over in Absinthe.Relay to make sure that we can get it to work with all of these changes.

@benwilson512 benwilson512 merged commit 01be95b into master Sep 20, 2018
@binaryseed
Copy link
Contributor

closes #222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants