Q:

Clojure: How to add scalar type in lacinia Graphql schema in edn format?

I want to define scalar type such as Token
if I define Token in following format it fails to compile 
:scalars
  {:Token }

According to https://lacinia.readthedocs.io/en/latest/custom-scalars.html , I need to give parse and seririase functions 
So I have modified code below, 
 :scalars
   {:Token 
     {:parse #(str %)
      :serialize #(str %)
     }
   }

Now I am getting error as " No dispatch macro for: ("
How I can define scalar type token as "scalar Token"?

A:

Like nha says in the comments, you can't have function literals in edn files. If you move this to a .clj file it'll work.
If you do want to keep the schema as an .edn file though, there's the function com.walmartlabs.lacinia.util/attach-scalar-transformers for that.
schema.edn:
{,,,
 :scalars
 {:Token {:parse :token-parser
          :serialize :token-serializer}}}

schema.clj
(ns foo.schema
  (:require
   [??? :refer [slurp-edn]]
   [com.walmartlabs.lacinia.schema :as schema]
   [com.walmartlabs.lacinia.util :as util]))

(def transforms
  {:token-parser #(,,,)
   :token-serializer #(,,,)})

(defn schema []
  (-> (slurp-edn "schema.edn")
      (util/attach-scalar-transformers transforms)
      ;; ... attach resolvers, compile schema, etc
      ))

