-
-
Notifications
You must be signed in to change notification settings - Fork 569
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stage 1 of behavior overhaul (#2160)
- Loading branch information
Showing
108 changed files
with
7,891 additions
and
7,836 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
"graphile-build": patch | ||
--- | ||
|
||
Fix bug where creating the build object also initialized it; this is incorrect | ||
since if you just want the build object you don't necessarily want to register | ||
all of the GraphQL types (and potentially discover naming conflicts) at that | ||
moment. Introduced new | ||
`schemaBuilder.initBuild(schemaBuilder.createBuild(input))` API to explicitly | ||
handle initing if you need an initialized build object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
"graphile-build-pg": patch | ||
"graphile-build": patch | ||
"postgraphile": patch | ||
--- | ||
|
||
Massive overhaul of the behavior system which now has a centralized registry of | ||
known behaviors and applies behaviors in a more careful and nuanced way, | ||
removing many hacks and workarounds, and ultimately meaning that | ||
`defaultBehavior: "-*"` should now operate correctly. Importantly, | ||
`addBehaviorToTags()` has been removed - you should use | ||
`plugin.schema.entityBehaviors` to indicate behaviors as shown in this PR - do | ||
not mod the tags directly unless they're explicitly meant to be overrides. | ||
|
||
Technically this is a significant breaking change (besides the removal of the | ||
`addBehaviorToTags()` helper) because the order in which behaviors are applied | ||
has changed, and so a different behavior might ultimately "win". This shows up | ||
in places where there is ambiguity, for example if you add `@filterable` to a | ||
function that you don't have execute permissions on, that function will now show | ||
up in the schema since user overrides (smart tags) "win" versus inferred | ||
behaviors such as introspected permissions; this wasn't the case before. | ||
Hopefully most users will not notice any difference, and for those who do, the | ||
`graphile behavior debug` CLI may be able to help you figure out what's going | ||
on. | ||
|
||
Be sure to print your schema before and after this update and look for changes; | ||
if there are changes then you likely need to fix the relevant behaviors/smart | ||
tags. (Hopefully there's no changes for you!) | ||
|
||
You'll also need to change any places where you're specifying behaviors that | ||
will be type checked; you can either cast your existing strings e.g. | ||
`defaultBehavior: "+connection -list" as GraphileBuild.BehaviorString`, or | ||
preferably you can specify your behaviors as an array, which should give you | ||
auto-complete on each entry; e.g. `defaultBehavior: ["connection", "-list"]`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"graphile": patch | ||
--- | ||
|
||
Fix interactions with behavior system, including fixing debugging behaviors when | ||
naming conflicts occur in the schema. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"graphile-config": patch | ||
--- | ||
|
||
Add support for lists of hook objects, so that the same hook can be applied | ||
multiple times in the same plugin but with different priorities. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.