Skip to content

Commit

Permalink
Update sample GraphQL files
Browse files Browse the repository at this point in the history
These are borrowed from the graphql-js project.
  • Loading branch information
jparise committed Jan 15, 2023
1 parent 1292e4e commit 42818fb
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 22 deletions.
2 changes: 1 addition & 1 deletion samples/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 GraphQL Contributors
Copyright (c) GraphQL Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
47 changes: 35 additions & 12 deletions samples/kitchen-sink.graphql
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
query queryName($foo: ComplexType, $site: Site = MOBILE) @onQuery {
whoever123is: node(id: [123, 456]) {
id ,
id
... on User @onInlineFragment {
field2 {
id ,
alias: field1(first:10, after:$foo,) @include(if: $foo) {
id,
id
alias: field1(first: 10, after: $foo) @include(if: $foo) {
id
...frag @onFragmentSpread
}
}

field3!
field4?
requiredField5: field5!
requiredSelectionSet(first: 10)! @directive {
field
}

unsetListItemsRequiredList: listField[]!
requiredListItemsUnsetList: listField[!]
requiredListItemsRequiredList: listField[!]!
unsetListItemsOptionalList: listField[]?
optionalListItemsUnsetList: listField[?]
optionalListItemsOptionalList: listField[?]?
multidimensionalList: listField[[[!]!]!]!
}
... @skip(unless: $foo) {
id
Expand All @@ -28,8 +43,9 @@ mutation likeStory @onMutation {
}

subscription StoryLikeSubscription(
$input: StoryLikeSubscribeInput
) @onSubscription {
$input: StoryLikeSubscribeInput @onVariableDefinition
)
@onSubscription {
storyLikeSubscribe(input: $input) {
story {
likers {
Expand All @@ -43,16 +59,23 @@ subscription StoryLikeSubscription(
}

fragment frag on Friend @onFragmentDefinition {
foo(size: $size, bar: $b, obj: {key: "value", block: """
foo(
size: $size
bar: $b
obj: {
key: "value"
block: """
block string uses \"""

"""})
"""
}
)
}
{
unnamed(truthy: true, falsy: false, nullish: null),
unnamed(truthy: true, falsy: false, nullish: null)
query
}
query { __typename }
query {
__typename
}
19 changes: 10 additions & 9 deletions samples/schema-kitchen-sink.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ schema {

"""
This is a description
of the `Foo` type.
of the \`Foo\` type.
"""
type Foo implements Bar & Baz & Two {
"Description of the `one` field."
"Description of the \`one\` field."
one: Type
"""
This is a description of the `two` field.
This is a description of the \`two\` field.
"""
two(
"""
This is a description of the `argument` argument.
This is a description of the \`argument\` argument.
"""
argument: InputType!
): Type
"""This is a description of the `three` field."""
"""This is a description of the \`three\` field."""
three(argument: InputType, other: String): Int
four(argument: String = "string"): String
five(argument: [String] = ["string", "string"]): String
Expand Down Expand Up @@ -85,14 +85,14 @@ extend scalar CustomScalar @onScalar

enum Site {
"""
This is a description of the `DESKTOP` value
This is a description of the \`DESKTOP\` value
"""
DESKTOP

"""This is a description of the `MOBILE` value"""
"""This is a description of the \`MOBILE\` value"""
MOBILE

"This is a description of the `WEB` value"
"This is a description of the \`WEB\` value"
WEB
}

Expand Down Expand Up @@ -127,9 +127,10 @@ extend input InputType {
extend input InputType @onInputObject

"""
This is a description of the `@skip` directive
This is a description of the \`@skip\` directive
"""
directive @skip(
"""This is a description of the \`if\` argument"""
if: Boolean! @onArgumentDefinition
) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT

Expand Down

0 comments on commit 42818fb

Please sign in to comment.