-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Graphql console controller #4834
Add Graphql console controller #4834
Conversation
Signed-off-by: Andrew Welch <[email protected]>
Example output: """
This directive allows for formatting any date to the desired format. It can be
applied to all fields, but changes anything only when applied to a DateTime
"""
directive @formatDateTime(
"""This specifies the format to use. It defaults to the [Atom date time"""
format: String = "Y-m-d\\\\TH:i:sP"
"""
The full name of the timezone, defaults to UTC. (E.g., America/New_York)
"""
timezone: String = "UTC"
) on FIELD
"""
This directive is used to return a URL for an [asset
tranform](https://docs.craftcms.com/v3/image-transforms.html). It accepts the
same arguments you would use for a transform in Craft and adds the `immediately`
"""
directive @transform(
"""The handle of the named transform to use."""
handle: String
"""Width for the generated transform"""
width: Int
"""Height for the generated transform"""
height: Int
"""The mode to use for the generated transform."""
mode: String
"""The position to use when cropping, if no focal point specified."""
position: String
"""The interlace mode to use for the transform"""
interlace: String
"""The quality of the transform"""
quality: Int
"""The format to use for the transform"""
format: String
"""
Whether the transform should be generated immediately or only when the image is requested us
ed the generated URL
"""
immediately: Boolean
) on FIELD
"""This is the interface implemented by all assets."""
interface AssetInterface {
"""The id of the entity"""
id: ID
"""The uid of the entity"""
uid: String
"""The element’s title."""
title: String
"""The element’s slug."""
slug: String
"""The element’s URI."""
uri: String
"""Whether the element is enabled or not."""
enabled: Boolean
"""Whether the element is archived or not."""
archived: Boolean
"""The ID of the site the element is associated with."""
siteId: Int
"""
The element’s search score, if the `search` parameter was used when querying for the element
.
"""
searchScore: String
"""Whether the element has been soft-deleted or not."""
trashed: Boolean
"""The element's status."""
status: String
"""The date the element was created."""
dateCreated: DateTime
"""The date the element was last updated."""
dateUpdated: DateTime
"""The ID of the volume that the asset belongs to."""
volumeId: Int
"""The ID of the folder that the asset belongs to."""
folderId: Int
"""The filename of the asset file."""
filename: String
"""The file extension for the asset file."""
extension: String
"""Whether a user-defined focal point is set on the asset."""
hasFocalPoint: Boolean
"""
The focal point represented as an array with `x` and `y` keys, or null if it's not an image.
"""
focalPoint: [Float]
"""The file kind."""
kind: String
"""The file size in bytes."""
size: String
"""The height in pixels or null if it's not an image."""
height: Int
"""The width in pixels or null if it's not an image."""
width: Int
"""An `<img>` tag based on this asset."""
img: String
"""The full URL of the asset."""
url: String
"""The file’s MIME type, if it can be determined."""
mimeType: String
"""The asset's path in the volume."""
path: String
"""The date the asset file was last modified."""
dateModified: DateTime
}
"""The `DateTime` scalar type represents a point in time."""
scalar DateTime
type Element implements ElementInterface {
"""The id of the entity"""
id: ID
"""The uid of the entity"""
uid: String
"""The element’s title."""
title: String
"""The element’s slug."""
slug: String
"""The element’s URI."""
uri: String
"""Whether the element is enabled or not."""
enabled: Boolean
"""Whether the element is archived or not."""
archived: Boolean
"""The ID of the site the element is associated with."""
siteId: Int
"""
The element’s search score, if the `search` parameter was used when querying for the element
.
"""
searchScore: String
"""Whether the element has been soft-deleted or not."""
trashed: Boolean
"""The element's status."""
status: String
"""The date the element was created."""
dateCreated: DateTime
"""The date the element was last updated."""
dateUpdated: DateTime
} |
Codecov Report
@@ Coverage Diff @@
## develop #4834 +/- ##
=============================================
- Coverage 33.6% 33.57% -0.04%
- Complexity 13563 13573 +10
=============================================
Files 602 603 +1
Lines 40846 40884 +38
=============================================
Hits 13726 13726
- Misses 27120 27158 +38
Continue to review full report at Codecov.
|
Awesome work @khalwat! In addition to the 👍 I would also like to say this will be a huge help to our workflow since our headless CMS does not have When we run headless we only spin up temporary review apps for each release but we don't need a long-running staging server in between releases because we don't need to worry about any frontend twig templates breaking. |
Signed-off-by: Andrew Welch <[email protected]>
Signed-off-by: Andrew Welch <[email protected]>
You are a beautiful man and let noone tell you otherwise. |
Adds two console commands:
graphql/dump-schema
Dump out a given GraphQL schema to a filegraphql/print-schema
Print out a given GraphQL schemaBoth operate on either the currently active schema, or fall back on the public schema. You can also pass a
token
parameter in to designate a schema by token:e.g.:
This is especially useful for IDE auto-completion of GraphQL schemas.