-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #335 from walmartlabs/20200918-directives
Add com.walmartlabs.lacinia.executor/selection
- Loading branch information
Showing
30 changed files
with
981 additions
and
212 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
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 @@ | ||
directive @auth (role: String!) on FIELD_DEFINITION | ||
|
||
directive @limit(value: Int = 10) on FIELD | ||
|
||
schema { query: Query } | ||
|
||
type Query { | ||
basic: [String]! | ||
} | ||
|
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,15 @@ | ||
directive @auth (role: String!) on ENUM | ||
|
||
schema { query: Query } | ||
|
||
enum Rank @auth(role: "enum") { INTRO, JUNIOR, SENIOR } | ||
|
||
type User { | ||
name: String! | ||
rank: Rank | ||
} | ||
|
||
type Query { | ||
me: User | ||
} | ||
|
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,24 @@ | ||
directive @auth (role: String!) on OBJECT | INTERFACE | ||
|
||
schema { query: Query } | ||
|
||
interface User @auth(role: "basic") { | ||
name: String! | ||
} | ||
|
||
type LegacyUser implements User @auth(role: "hidden") { | ||
name: String! | ||
userId: Int! | ||
} | ||
|
||
type ActiveUser implements User { | ||
name: String! | ||
userId: String! | ||
} | ||
|
||
type Query { | ||
me: User | ||
|
||
friends: [User!]! | ||
} | ||
|
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,15 @@ | ||
directive @auth (role: String!) on OBJECT | FIELD_DEFINITION | ||
|
||
schema { query: Query } | ||
|
||
type User @auth(role: "basic") { | ||
name: String! @auth(role: "advanced") | ||
department: String! | ||
} | ||
|
||
type Query { | ||
me: User | ||
|
||
friends: [User!]! | ||
} | ||
|
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,15 @@ | ||
schema { query: Query } | ||
|
||
directive @auth (role: String!) on SCALAR | ||
|
||
scalar UUID @auth(role: "basic") | ||
|
||
type User { | ||
name: String! | ||
id: UUID | ||
} | ||
|
||
type Query { | ||
me: User | ||
} | ||
|
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 @@ | ||
directive @auth (role: String!) on FIELD_DEFINITION | ||
|
||
directive @concise on FIELD | ||
|
||
schema { query: Query } | ||
|
||
type Query { | ||
basic: String! @auth(role: "basic") | ||
} | ||
|
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,22 @@ | ||
directive @auth (role: String!) on OBJECT | UNION | ||
|
||
schema { query: Query } | ||
|
||
union User @auth(role: "basic") = ActiveUser | LegacyUser | ||
|
||
type LegacyUser @auth(role: "hidden") { | ||
userName: String! | ||
userId: Int! | ||
} | ||
|
||
type ActiveUser { | ||
name: String! | ||
idCode: String! | ||
} | ||
|
||
type Query { | ||
me: User | ||
|
||
friends: [User!]! | ||
} | ||
|
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.