-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a option to format GQL without description (#325)
- Loading branch information
Showing
24 changed files
with
429 additions
and
5 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
7 changes: 7 additions & 0 deletions
7
formatter/testdata/baseline/FormatQueryDocument/no_description/basic.graphql
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,7 @@ | ||
query FooBarQuery ($after: String!) { | ||
fizzList(first: 100, after: $after) { | ||
nodes { | ||
id | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
formatter/testdata/baseline/FormatQueryDocument/no_description/field.graphql
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,3 @@ | ||
query { | ||
bar: foo | ||
} |
18 changes: 18 additions & 0 deletions
18
formatter/testdata/baseline/FormatQueryDocument/no_description/fragment.graphql
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,18 @@ | ||
query FooBarQuery ($after: String!) { | ||
fizzList(first: 100, after: $after) { | ||
nodes { | ||
id | ||
... FooFragment | ||
... on Foo { | ||
id | ||
} | ||
... { | ||
id | ||
} | ||
name | ||
} | ||
} | ||
} | ||
fragment FooFragment on Foo { | ||
id | ||
} |
8 changes: 8 additions & 0 deletions
8
formatter/testdata/baseline/FormatQueryDocument/no_description/variable.graphql
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,8 @@ | ||
query ($first: Int = 30, $after: String!) { | ||
searchCats(first: $first, after: $after) { | ||
nodes { | ||
id | ||
name | ||
} | ||
} | ||
} |
Empty file.
24 changes: 24 additions & 0 deletions
24
formatter/testdata/baseline/FormatSchema/no_description/definition.graphql
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 @@ | ||
scalar Cat0 | ||
type Cat1 { | ||
name: String | ||
} | ||
interface Cat2 { | ||
name: String | ||
} | ||
union Cat3 = Cat3_0 | Cat3_1 | Cat3_2 | ||
type Cat3_0 { | ||
name: String | ||
} | ||
type Cat3_1 { | ||
name: String | ||
} | ||
type Cat3_2 { | ||
name: String | ||
} | ||
enum Cat4 { | ||
NFC | ||
MAINECOON | ||
} | ||
input Cat5 { | ||
name: String | ||
} |
4 changes: 4 additions & 0 deletions
4
formatter/testdata/baseline/FormatSchema/no_description/description.graphql
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,4 @@ | ||
type Cat { | ||
name: String | ||
speaks: String | ||
} |
2 changes: 2 additions & 0 deletions
2
formatter/testdata/baseline/FormatSchema/no_description/directive.graphql
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,2 @@ | ||
directive @bar repeatable on FIELD | OBJECT | ||
directive @foo on FIELD | OBJECT |
13 changes: 13 additions & 0 deletions
13
formatter/testdata/baseline/FormatSchema/no_description/directive_locations.graphql
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,13 @@ | ||
directive @foo on OBJECT | UNION | ENUM | ||
enum ConnectionStatus @foo { | ||
ONLINE | ||
OFFLINE | ||
ERROR | ||
} | ||
interface Named { | ||
name: String! | ||
} | ||
type Person implements Named @foo { | ||
name: String! | ||
} | ||
union PersonUnion @foo = Person |
16 changes: 16 additions & 0 deletions
16
formatter/testdata/baseline/FormatSchema/no_description/extensions.graphql
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,16 @@ | ||
directive @extends on OBJECT | ||
directive @key(fields: String!) on OBJECT | INTERFACE | ||
directive @permission(permission: String!) on FIELD_DEFINITION | ||
type Dog { | ||
name: String! | ||
owner: Person! @permission(permission: "admin") | ||
} | ||
type Person @key(fields: "name") { | ||
name: String! | ||
} | ||
type Query @extends { | ||
dogs: [Dog!]! | ||
} | ||
type Subscription { | ||
dogEvents: [Dog!]! | ||
} |
3 changes: 3 additions & 0 deletions
3
formatter/testdata/baseline/FormatSchema/no_description/field_definition.graphql
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,3 @@ | ||
input CatInput { | ||
food: String = "fish & meat" | ||
} |
34 changes: 34 additions & 0 deletions
34
formatter/testdata/baseline/FormatSchema/no_description/schema.graphql
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 @@ | ||
schema { | ||
query: TopQuery | ||
mutation: TopMutation | ||
subscription: TopSubscription | ||
} | ||
type TopMutation { | ||
noop: Boolean | ||
noop2( | ||
arg: String | ||
): Boolean | ||
noop3( | ||
arg: String | ||
): Boolean | ||
} | ||
type TopQuery { | ||
noop: Boolean | ||
noop2( | ||
arg: String | ||
): Boolean | ||
noop3( | ||
arg: String | ||
): Boolean | ||
} | ||
type TopSubscription { | ||
noop: Boolean | ||
noop2( | ||
arg: String | ||
): Boolean | ||
noop3( | ||
arg1: String | ||
|
||
arg2: String | ||
): Boolean | ||
} |
87 changes: 87 additions & 0 deletions
87
formatter/testdata/baseline/FormatSchema/no_description/swapi.graphql
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,87 @@ | ||
interface Character { | ||
id: ID! | ||
name: String! | ||
friends: [Character] | ||
friendsConnection(first: Int, after: ID): FriendsConnection! | ||
appearsIn: [Episode]! | ||
} | ||
input ColorInput { | ||
red: Int! | ||
green: Int! | ||
blue: Int! | ||
} | ||
type Droid implements Character { | ||
id: ID! | ||
name: String! | ||
friends: [Character] | ||
friendsConnection(first: Int, after: ID): FriendsConnection! | ||
appearsIn: [Episode]! | ||
primaryFunction: String | ||
} | ||
enum Episode { | ||
NEWHOPE | ||
EMPIRE | ||
JEDI | ||
} | ||
type FriendsConnection { | ||
totalCount: Int | ||
edges: [FriendsEdge] | ||
friends: [Character] | ||
pageInfo: PageInfo! | ||
} | ||
type FriendsEdge { | ||
cursor: ID! | ||
node: Character | ||
} | ||
type Human implements Character { | ||
id: ID! | ||
name: String! | ||
homePlanet: String | ||
height(unit: LengthUnit = METER): Float | ||
mass: Float | ||
friends: [Character] | ||
friendsConnection(first: Int, after: ID): FriendsConnection! | ||
appearsIn: [Episode]! | ||
starships: [Starship] | ||
} | ||
enum LengthUnit { | ||
METER | ||
FOOT | ||
} | ||
type Mutation { | ||
createReview(episode: Episode, review: ReviewInput!): Review | ||
} | ||
type PageInfo { | ||
startCursor: ID | ||
endCursor: ID | ||
hasNextPage: Boolean! | ||
} | ||
type Query { | ||
hero(episode: Episode): Character | ||
reviews(episode: Episode!): [Review] | ||
search(text: String): [SearchResult] | ||
character(id: ID!): Character | ||
droid(id: ID!): Droid | ||
human(id: ID!): Human | ||
starship(id: ID!): Starship | ||
} | ||
type Review { | ||
episode: Episode | ||
stars: Int! | ||
commentary: String | ||
} | ||
input ReviewInput { | ||
stars: Int! | ||
commentary: String | ||
favorite_color: ColorInput | ||
} | ||
union SearchResult = Human | Droid | Starship | ||
type Starship { | ||
id: ID! | ||
name: String! | ||
length(unit: LengthUnit = METER): Float | ||
coordinates: [[Float!]!] | ||
} | ||
type Subscription { | ||
reviewAdded(episode: Episode): Review | ||
} |
Empty file.
24 changes: 24 additions & 0 deletions
24
formatter/testdata/baseline/FormatSchemaDocument/no_description/definition.graphql
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 @@ | ||
scalar Cat0 | ||
type Cat1 { | ||
name: String | ||
} | ||
interface Cat2 { | ||
name: String | ||
} | ||
type Cat3_0 { | ||
name: String | ||
} | ||
type Cat3_1 { | ||
name: String | ||
} | ||
type Cat3_2 { | ||
name: String | ||
} | ||
union Cat3 = Cat3_0 | Cat3_1 | Cat3_2 | ||
enum Cat4 { | ||
NFC | ||
MAINECOON | ||
} | ||
input Cat5 { | ||
name: String | ||
} |
4 changes: 4 additions & 0 deletions
4
formatter/testdata/baseline/FormatSchemaDocument/no_description/description.graphql
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,4 @@ | ||
type Cat { | ||
name: String | ||
speaks: String | ||
} |
2 changes: 2 additions & 0 deletions
2
formatter/testdata/baseline/FormatSchemaDocument/no_description/directive.graphql
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,2 @@ | ||
directive @foo on FIELD | OBJECT | ||
directive @bar repeatable on FIELD | OBJECT |
13 changes: 13 additions & 0 deletions
13
formatter/testdata/baseline/FormatSchemaDocument/no_description/directive_locations.graphql
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,13 @@ | ||
directive @foo on OBJECT | UNION | ENUM | ||
interface Named { | ||
name: String! | ||
} | ||
type Person implements Named @foo { | ||
name: String! | ||
} | ||
enum ConnectionStatus @foo { | ||
ONLINE | ||
OFFLINE | ||
ERROR | ||
} | ||
union PersonUnion @foo = Person |
24 changes: 24 additions & 0 deletions
24
formatter/testdata/baseline/FormatSchemaDocument/no_description/extensions.graphql
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 @@ | ||
schema { | ||
query: Query | ||
} | ||
extend schema { | ||
subscription: Subscription | ||
} | ||
directive @permission(permission: String!) on FIELD_DEFINITION | ||
directive @extends on OBJECT | ||
directive @key(fields: String!) on OBJECT | INTERFACE | ||
type Query @extends { | ||
dogs: [Dog!]! | ||
} | ||
type Subscription { | ||
dogEvents: [Dog!]! | ||
} | ||
type Dog { | ||
name: String! | ||
} | ||
type Person @key(fields: "name") { | ||
name: String! | ||
} | ||
extend type Dog { | ||
owner: Person! @permission(permission: "admin") | ||
} |
3 changes: 3 additions & 0 deletions
3
formatter/testdata/baseline/FormatSchemaDocument/no_description/field_definition.graphql
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,3 @@ | ||
input CatInput { | ||
food: String = "fish & meat" | ||
} |
34 changes: 34 additions & 0 deletions
34
formatter/testdata/baseline/FormatSchemaDocument/no_description/schema.graphql
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 @@ | ||
schema { | ||
query: TopQuery | ||
mutation: TopMutation | ||
subscription: TopSubscription | ||
} | ||
type TopMutation { | ||
noop: Boolean | ||
noop2( | ||
arg: String | ||
): Boolean | ||
noop3( | ||
arg: String | ||
): Boolean | ||
} | ||
type TopQuery { | ||
noop: Boolean | ||
noop2( | ||
arg: String | ||
): Boolean | ||
noop3( | ||
arg: String | ||
): Boolean | ||
} | ||
type TopSubscription { | ||
noop: Boolean | ||
noop2( | ||
arg: String | ||
): Boolean | ||
noop3( | ||
arg1: String | ||
|
||
arg2: String | ||
): Boolean | ||
} |
Oops, something went wrong.