Skip to content

Commit

Permalink
Update schema.
Browse files Browse the repository at this point in the history
  • Loading branch information
ychescale9 committed Aug 24, 2024
1 parent da66662 commit c4aa0fc
Showing 1 changed file with 8 additions and 281 deletions.
289 changes: 8 additions & 281 deletions kmp/remote/cloud/src/commonMain/graphql/schema.graphqls
Original file line number Diff line number Diff line change
@@ -1,260 +1,3 @@
enum ErrorDetail {
"""
Unknown error.
This error should only be returned when no other error detail applies.
If a client sees an unknown errorDetail, it will be interpreted as UNKNOWN.
HTTP Mapping: 500 Internal Server Error
"""
UNKNOWN

"""
The requested field is not found in the schema.
This differs from `NOT_FOUND` in that `NOT_FOUND` should be used when a
query is valid, but is unable to return a result (if, for example, a
specific video id doesn't exist). `FIELD_NOT_FOUND` is intended to be
returned by the server to signify that the requested field is not known to exist.
This may be returned in lieu of failing the entire query.
See also `PERMISSION_DENIED` for cases where the
requested field is invalid only for the given user or class of users.
HTTP Mapping: 404 Not Found
Error Type: BAD_REQUEST
"""
FIELD_NOT_FOUND

"""
The provided cursor is not valid.
The most common usage for this error is when a client is paginating
through a list that uses stateful cursors. In that case, the provided
cursor may be expired.
HTTP Mapping: 404 Not Found
Error Type: NOT_FOUND
"""
INVALID_CURSOR

"""
The operation is not implemented or is not currently supported/enabled.
HTTP Mapping: 501 Not Implemented
Error Type: BAD_REQUEST
"""
UNIMPLEMENTED

"""
The client specified an invalid argument.
Note that this differs from `FAILED_PRECONDITION`.
`INVALID_ARGUMENT` indicates arguments that are problematic
regardless of the state of the system (e.g., a malformed file name).
HTTP Mapping: 400 Bad Request
Error Type: BAD_REQUEST
"""
INVALID_ARGUMENT

"""
The deadline expired before the operation could complete.
For operations that change the state of the system, this error
may be returned even if the operation has completed successfully.
For example, a successful response from a server could have been
delayed long enough for the deadline to expire.
HTTP Mapping: 504 Gateway Timeout
Error Type: UNAVAILABLE
"""
DEADLINE_EXCEEDED

"""
Service Error.
There is a problem with an upstream service.
This may be returned if a gateway receives an unknown error from a service
or if a service is unreachable.
If a request times out which waiting on a response from a service,
`DEADLINE_EXCEEDED` may be returned instead.
If a service returns a more specific error Type, the specific error Type may
be returned instead.
HTTP Mapping: 502 Bad Gateway
Error Type: UNAVAILABLE
"""
SERVICE_ERROR

"""
Request throttled based on server CPU limits
HTTP Mapping: 503 Unavailable.
Error Type: UNAVAILABLE
"""
THROTTLED_CPU

"""
Request throttled based on server concurrency limits.
HTTP Mapping: 503 Unavailable
Error Type: UNAVAILABLE
"""
THROTTLED_CONCURRENCY

"""
The server detected that the client is exhibiting a behavior that
might be generating excessive load.
HTTP Mapping: 429 Too Many Requests or 420 Enhance Your Calm
Error Type: UNAVAILABLE
"""
ENHANCE_YOUR_CALM

"""
Request failed due to network errors.
HTTP Mapping: 503 Unavailable
Error Type: UNAVAILABLE
"""
TCP_FAILURE

"""
Unable to perform operation because a required resource is missing.
Example: Client is attempting to refresh a list, but the specified
list is expired. This requires an action by the client to get a new list.
If the user is simply trying GET a resource that is not found,
use the NOT_FOUND error type. FAILED_PRECONDITION.MISSING_RESOURCE
is to be used particularly when the user is performing an operation
that requires a particular resource to exist.
HTTP Mapping: 400 Bad Request or 500 Internal Server Error
Error Type: FAILED_PRECONDITION
"""
MISSING_RESOURCE
}

enum ErrorType {
"""
Unknown error.
For example, this error may be returned when
an error code received from another address space belongs to
an error space that is not known in this address space. Also
errors raised by APIs that do not return enough error information
may be converted to this error.
If a client sees an unknown errorType, it will be interpreted as UNKNOWN.
Unknown errors MUST NOT trigger any special behavior. These MAY be treated
by an implementation as being equivalent to INTERNAL.
When possible, a more specific error should be provided.
HTTP Mapping: 520 Unknown Error
"""
UNKNOWN

"""
Internal error.
An unexpected internal error was encountered. This means that some
invariants expected by the underlying system have been broken.
This error code is reserved for serious errors.
HTTP Mapping: 500 Internal Server Error
"""
INTERNAL

"""
The requested entity was not found.
This could apply to a resource that has never existed (e.g. bad resource id),
or a resource that no longer exists (e.g. cache expired.)
Note to server developers: if a request is denied for an entire class
of users, such as gradual feature rollout or undocumented allowlist,
`NOT_FOUND` may be used. If a request is denied for some users within
a class of users, such as user-based access control, `PERMISSION_DENIED`
must be used.
HTTP Mapping: 404 Not Found
"""
NOT_FOUND

"""
The request does not have valid authentication credentials.
This is intended to be returned only for routes that require
authentication.
HTTP Mapping: 401 Unauthorized
"""
UNAUTHENTICATED

"""
The caller does not have permission to execute the specified
operation.
`PERMISSION_DENIED` must not be used for rejections
caused by exhausting some resource or quota.
`PERMISSION_DENIED` must not be used if the caller
cannot be identified (use `UNAUTHENTICATED`
instead for those errors).
This error Type does not imply the
request is valid or the requested entity exists or satisfies
other pre-conditions.
HTTP Mapping: 403 Forbidden
"""
PERMISSION_DENIED

"""
Bad Request.
There is a problem with the request.
Retrying the same request is not likely to succeed.
An example would be a query or argument that cannot be deserialized.
HTTP Mapping: 400 Bad Request
"""
BAD_REQUEST

"""
Currently Unavailable.
The service is currently unavailable. This is most likely a
transient condition, which can be corrected by retrying with
a backoff.
HTTP Mapping: 503 Unavailable
"""
UNAVAILABLE

"""
The operation was rejected because the system is not in a state
required for the operation's execution. For example, the directory
to be deleted is non-empty, an rmdir operation is applied to
a non-directory, etc.
Service implementers can use the following guidelines to decide
between `FAILED_PRECONDITION` and `UNAVAILABLE`:
- Use `UNAVAILABLE` if the client can retry just the failing call.
- Use `FAILED_PRECONDITION` if the client should not retry until
the system state has been explicitly fixed. E.g., if an "rmdir"
fails because the directory is non-empty, `FAILED_PRECONDITION`
should be returned since the client should not retry unless
the files are deleted from the directory.
HTTP Mapping: 400 Bad Request or 500 Internal Server Error
"""
FAILED_PRECONDITION
}

interface FeedEntry {
"""
Unique id of the feed entry.
Expand Down Expand Up @@ -466,6 +209,13 @@ type KotlinYouTube implements FeedEntry {
description: String!
}

type Mutation {
"""
Syncs feeds from all sources.
"""
syncFeeds: Boolean!
}

type Query {
"""
Returns list of entries from the selected sources in the provided filters.
Expand Down Expand Up @@ -533,8 +283,6 @@ type _Service {
sdl: String!
}

# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
# noinspection GraphQLTypeRedefinition
type __Directive {
"""
The __Directive type represents a Directive that a server supports.
Expand All @@ -550,8 +298,6 @@ type __Directive {
args(includeDeprecated: Boolean = false): [__InputValue!]!
}

# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
# noinspection GraphQLTypeRedefinition
"""
An enum describing valid locations where a directive can be placed
"""
Expand Down Expand Up @@ -652,8 +398,6 @@ enum __DirectiveLocation {
INPUT_FIELD_DEFINITION
}

# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
# noinspection GraphQLTypeRedefinition
type __EnumValue {
name: String!

Expand All @@ -664,8 +408,6 @@ type __EnumValue {
deprecationReason: String
}

# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
# noinspection GraphQLTypeRedefinition
type __Field {
name: String!

Expand All @@ -680,8 +422,6 @@ type __Field {
deprecationReason: String
}

# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
# noinspection GraphQLTypeRedefinition
type __InputValue {
name: String!

Expand All @@ -696,8 +436,6 @@ type __InputValue {
deprecationReason: String
}

# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
# noinspection GraphQLTypeRedefinition
"""
A GraphQL Introspection defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, the entry points for query, mutation, and subscription operations.
"""
Expand Down Expand Up @@ -730,8 +468,6 @@ type __Schema {
subscriptionType: __Type
}

# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
# noinspection GraphQLTypeRedefinition
type __Type {
kind: __TypeKind!

Expand Down Expand Up @@ -761,8 +497,6 @@ type __Type {
specifiedByUrl: String @deprecated(reason: "This legacy name has been replaced by `specifiedByURL`")
}

# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
# noinspection GraphQLTypeRedefinition
"""
An enum describing what kind of type a given __Type is
"""
Expand Down Expand Up @@ -808,15 +542,11 @@ enum __TypeKind {
NON_NULL
}

# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
# noinspection GraphQLTypeRedefinition
"""
Directs the executor to include this field or fragment only when the `if` argument is true
"""
directive @include ("Included when true." if: Boolean!) on FIELD|FRAGMENT_SPREAD|INLINE_FRAGMENT

# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
# noinspection GraphQLTypeRedefinition
"""
Directs the executor to skip this field or fragment when the `if` argument is true.
"""
Expand All @@ -832,15 +562,11 @@ directive @provides (fields: _FieldSet!) on FIELD_DEFINITION

directive @requires (fields: _FieldSet!) on FIELD_DEFINITION

# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
# noinspection GraphQLTypeRedefinition
"""
Marks the field, argument, input field or enum value as deprecated
"""
directive @deprecated ("The reason for the deprecation" reason: String = "No longer supported") on FIELD_DEFINITION|ARGUMENT_DEFINITION|ENUM_VALUE|INPUT_FIELD_DEFINITION

# See https://github.com/JetBrains/js-graphql-intellij-plugin/issues/665
# noinspection GraphQLTypeRedefinition
"""
Exposes a URL that specifies the behaviour of this scalar.
"""
Expand All @@ -853,4 +579,5 @@ directive @oneOf on INPUT_OBJECT

schema {
query: Query
mutation: Mutation
}

0 comments on commit c4aa0fc

Please sign in to comment.