forked from github-linguist/linguist
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for GraphQL (github-linguist#2947)
* Add GraphQL to languages.yml * Add graphql submodule * Add graphql to grammars.yml * Add GraphQL samples * Updating licensed information
- Loading branch information
1 parent
7c9fd59
commit bce676e
Showing
7 changed files
with
128 additions
and
0 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
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,57 @@ | ||
# Copyright (c) 2015, Facebook, Inc. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. An additional grant | ||
# of patent rights can be found in the PATENTS file in the same directory. | ||
|
||
query queryName($foo: ComplexType, $site: Site = MOBILE) { | ||
whoever123is: node(id: [123, 456]) { | ||
id , | ||
... on User @defer { | ||
field2 { | ||
id , | ||
alias: field1(first:10, after:$foo,) @include(if: $foo) { | ||
id, | ||
...frag | ||
} | ||
} | ||
} | ||
... @skip(unless: $foo) { | ||
id | ||
} | ||
... { | ||
id | ||
} | ||
} | ||
} | ||
|
||
mutation likeStory { | ||
like(story: 123) @defer { | ||
story { | ||
id | ||
} | ||
} | ||
} | ||
|
||
subscription StoryLikeSubscription($input: StoryLikeSubscribeInput) { | ||
storyLikeSubscribe(input: $input) { | ||
story { | ||
likers { | ||
count | ||
} | ||
likeSentence { | ||
text | ||
} | ||
} | ||
} | ||
} | ||
|
||
fragment frag on Friend { | ||
foo(size: $size, bar: $b, obj: {key: "value"}) | ||
} | ||
|
||
{ | ||
unnamed(truthy: true, falsey: false), | ||
query | ||
} |
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,50 @@ | ||
# Copyright (c) 2015, Facebook, Inc. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. An additional grant | ||
# of patent rights can be found in the PATENTS file in the same directory. | ||
|
||
schema { | ||
query: QueryType | ||
mutation: MutationType | ||
} | ||
|
||
type Foo implements Bar { | ||
one: Type | ||
two(argument: InputType!): Type | ||
three(argument: InputType, other: String): Int | ||
four(argument: String = "string"): String | ||
five(argument: [String] = ["string", "string"]): String | ||
six(argument: InputType = {key: "value"}): Type | ||
} | ||
|
||
interface Bar { | ||
one: Type | ||
four(argument: String = "string"): String | ||
} | ||
|
||
union Feed = Story | Article | Advert | ||
|
||
scalar CustomScalar | ||
|
||
enum Site { | ||
DESKTOP | ||
MOBILE | ||
} | ||
|
||
input InputType { | ||
key: String! | ||
answer: Int = 42 | ||
} | ||
|
||
extend type Foo { | ||
seven(argument: [String]): Type | ||
} | ||
|
||
directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT | ||
|
||
directive @include(if: Boolean!) | ||
on FIELD | ||
| FRAGMENT_SPREAD | ||
| INLINE_FRAGMENT |
Submodule language-graphql
added at
037e5d
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 @@ | ||
--- | ||
type: grammar | ||
name: language-graphql | ||
license: mit | ||
curated: true | ||
--- | ||
MIT |