-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Missing copyright headers * Point to prerelease documentation for 2.0.0 branch * General housekeeping before release * Update code comment * Fix TCK tests broken from merge * fix(jwt): req.cookies might be undefined this fix prevents the app from crashing id req.cookies is undefined * Add scalars earlier in schema augmentation for use in types and interfaces without throwing Error (fixes DateTime relationship properties) * Changes to accomodate merge from master * fix: use package json for useragent name and version (#271) * fix: use package json for useragent name and version * fix: add userAgent support for <=4.2 and >=4.3 drivers * config: remove codeowners (#277) * Version update * fix(login): avoid confusion caused by secondary button (#265) * fix: losing params while creating Auth Predicate (#281) * fix: loosing params while creating Auth Predicate * fix: typos * fix: typo * feat: add projection to top level cypher directive (#251) * feat: add projection to top level queries and mutations using cypher directive * fix: add missing cypherParams * Fix for loss of scalar and field level resolvers (#297) * wrapCustomResolvers removed in favour of schema level resolver auth injection * Add test cases for this fix * Mention double escaping for @cypher directive * Version update * checkpoint: commit all changes to date - NOT WORKING * Committing before merging in 2.0.0 changes * Union connect and test needs fixing * Add .huskyrc back * Reformat schema TCK tests for better diff * Reorganise schema TCK for better diff * Create union input types in a map * Various work, including nested connects and disconnects for unions, fixing a variety of bugs * Documentation changes * Fix structure of nested creates for unions, and add tests for nested union mutations * Fix where input for nested update * Add integration tests for multiple union create/update Co-authored-by: gaspard <gaspard@gmail.com> Co-authored-by: Oskar Hane <oh@oskarhane.com> Co-authored-by: Daniel Starns <danielstarns@hotmail.com> Co-authored-by: Neo Technology Build Agent <continuous-integration+build-agent@neotechnology.com> Co-authored-by: Arnaud Gissinger <37625778+mathix420@users.noreply.github.com>
- Loading branch information
1 parent
b0fe269
commit 45ce973
Showing
23 changed files
with
2,698 additions
and
696 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
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,94 @@ | ||
[[rel-migration-unions]] | ||
= Unions | ||
|
||
The structure of input types for union queries and mutations have been changed for user friendliness, and a more consistent API. | ||
|
||
The examples in this section will be based off the following type definitions: | ||
|
||
[source, graphql] | ||
---- | ||
type Actor { | ||
name: String! | ||
actedIn: [Production!]! @relationship(type: "ACTED_IN", direction: OUT) | ||
} | ||
type Movie { | ||
title: String! | ||
actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) | ||
} | ||
type Series { | ||
title: String! | ||
actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN) | ||
} | ||
union Production = Movie | Series | ||
---- | ||
|
||
Essentially, field names which were previously of template `${unionFieldName}_${concreteType}` (for example, "actedIn_Movie") are now an object, with the field name at the top, and the member types under it. | ||
|
||
For example, a Mutation which would have previously been: | ||
|
||
[source, graphql] | ||
---- | ||
mutation { | ||
createActors( | ||
input: [ | ||
{ | ||
name: "Tom Hiddleston" | ||
actedIn_Movie: { | ||
create: [ | ||
{ | ||
title: "The Avengers" | ||
} | ||
] | ||
} | ||
actedIn_Series: { | ||
create: [ | ||
{ | ||
title: "Loki" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
) | ||
} | ||
---- | ||
|
||
Will now be: | ||
|
||
[source, graphql] | ||
---- | ||
mutation { | ||
createActors( | ||
input: [ | ||
{ | ||
name: "Tom Hiddleston" | ||
actedIn: { | ||
Movie: { | ||
create: [ | ||
{ | ||
node: { | ||
title: "The Avengers" | ||
} | ||
} | ||
] | ||
} | ||
Series: { | ||
create: [ | ||
{ | ||
node: { | ||
title: "Loki" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
) | ||
} | ||
---- | ||
|
||
Note the change in structure for union input, but also the additional `node` level which enables the use of relationship properties. These changes are consistent across all operations, including `where`. |
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.