Markdown Field

Sample Markdown Query

Query

{
articles {
body
}
}

Output

{
"data": {
"articles": [
{
"title": "A Brave New World",
"body": "# Hello"
}
]
}
}

Filtering by Markdown

Markdown filters support:

  • _not
  • _in
  • _not_in
  • _contains
  • _not_contains
  • _starts_with
  • _not_starts_with
  • _ends_with
  • _not_ends_with

body: String

{
articles(where: { body: "# Hello" }) {
body
}
}

body_not: String

{
articles(where: { body_not: "## Hello" }) {
body
}
}

body_in: [String!]

{
articles(where: { body_in: ["# Hello World"] }) {
body
}
}

body_not_in: [String!]

{
articles(where: { body_not_in: ["## Hello World"] }) {
body
}
}

body_contains: String

{
articles(where: { body_contains: "Hello" }) {
body
}
}

body_not_contains: String

{
articles(where: { body_not_contains: "Goodbye" }) {
body
}
}

body_starts_with: String

{
articles(where: { body_starts_with: "#" }) {
body
}
}

body_not_starts_with: String

{
articles(where: { body_not_starts_with: ">" }) {
body
}
}

body_ends_with: String

{
articles(where: { body_ends_with: "." }) {
body
}
}

body_not_ends_with: String

{
articles(where: { body_not_ends_with: "!" }) {
body
}
}

Mutating a Markdown

Mutation

mutation {
createArticle(data: { body: "# Hi!" }) {
body
}
}

Output

{
"data": {
"createArticle": {
"body": "# Hi!"
}
}
}

This site uses cookies to provide you with a better user experience. For more information, refer to our Privacy Policy