Skip to content

lsanwick/custom-scalar-caching-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

custom-scalar-caching-example

Demonstates an issue with query caching and JIT in Mercurius.

Installation

npm install && npm run dev

Reproduction

{
  testDateTime(date: "2023-05-17T08:25:00Z")
}
  • Observe the correct result:
{
  "data": {
    "testDateTime": "May 17, 2023"
  }
}
  • Run the query again by hitting Ctrl-Enter

  • Observe that the query now errors like so:

{
  "data": null,
  "errors": [
    {
      "message": "date.toFormat is not a function",
      "locations": [
        {
          "line": 2,
          "column": 1
        }
      ],
      "path": ["testDateTime"]
    }
  ]
}
  • Adjust formatting or indentation of the query and run it again, and it will succeed.

  • Disabling the jit option for Mercurius will solve the problem, as will leaving it enabled and marking cache: false.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published