~gavinok


#34 Examples nolonger work 2 years ago

Comment by ~gavinok on ~theo/gql

One idea you could try is using the same conversion that parenscript does

  • T
  • F
  • FALSE
  • NIL
  • UNDEFINED

T and FALSE (or F) are converted to their JavaScript boolean equivalents true and false.

NIL is converted to the JavaScript keyword null.

UNDEFINED is converted to the JavaScript global variable undefined.

https://parenscript.common-lisp.dev/reference.html#ssection-booleans

Only concern here would be the use of NIL since you would then have to consider the overlap of NIL and (). If you represent JS arrays as CL arrays this wouldn't be an issue.

Anyways just a thought that may interest you.

"~theo" outgoing@sr.ht writes:

[[PGP Signed Part:Undecided]] On 9 Jul 2022 08:33, ~gavinok outgoing@sr.ht wrote: Current example files are out of date. I have yet to learn the new api but at the moment at least example1.lisp is using the wrong api. For example

(defparameter *fields*
  (list
   (field :name "name"
               :type *string*
               :resolver (constantly "Theodor Thornhill"))
   (field :name "age"
               :type *int*
               :resolver (constantly 31))))

should be

(defparameter *fields*
  (list
   (field :name "name"
               :gql-type *string*
               :resolver (constantly "Theodor Thornhill"))
   (field :name "age"
               :gql-type *int*
               :resolver (constantly 31))))

You are absolutely correct that they are out of date, unfortunately. I'll see if I can update them this evening or so. I will also make a real list of actionable task for me and/others to work on so that it will be actually useful.

I'm struggling a bit on the coersion between nil/false/null/true problem in lisp vs js, but we'll get there :)

Also I finally have some summer holidays, so there's that :)

Thanks for your interest!

#34 Examples nolonger work 2 years ago

on ~theo/gql

One idea you could try is using the same conversion that parenscript does

  • T
  • F
  • FALSE
  • NIL
  • UNDEFINED

T and FALSE (or F) are converted to their JavaScript boolean equivalents true and false.

NIL is converted to the JavaScript keyword null.

UNDEFINED is converted to the JavaScript global variable undefined.

https://parenscript.common-lisp.dev/reference.html#ssection-booleans

Only concern here would be the use of NIL since you would then have to consider the overlap of NIL and (). If you represent JS arrays as CL arrays this wouldn't be an issue.

Anyways just a thought that may interest you.

"~theo" outgoing@sr.ht writes:

[[PGP Signed Part:Undecided]] On 9 Jul 2022 08:33, ~gavinok outgoing@sr.ht wrote: Current example files are out of date. I have yet to learn the new api but at the moment at least example1.lisp is using the wrong api. For example

(defparameter *fields*
  (list
   (field :name "name"
               :type *string*
               :resolver (constantly "Theodor Thornhill"))
   (field :name "age"
               :type *int*
               :resolver (constantly 31))))

should be

(defparameter *fields*
  (list
   (field :name "name"
               :gql-type *string*
               :resolver (constantly "Theodor Thornhill"))
   (field :name "age"
               :gql-type *int*
               :resolver (constantly 31))))

You are absolutely correct that they are out of date, unfortunately. I'll see if I can update them this evening or so. I will also make a real list of actionable task for me and/others to work on so that it will be actually useful.

I'm struggling a bit on the coersion between nil/false/null/true problem in lisp vs js, but we'll get there :)

Also I finally have some summer holidays, so there's that :)

Thanks for your interest!

#34 Examples nolonger work 2 years ago

on ~theo/gql

On 9 Jul 2022 08:33, ~gavinok outgoing@sr.ht wrote: Current example files are out of date. I have yet to learn the new api but at the moment at least example1.lisp is using the wrong api. For example

(defparameter *fields*
  (list
   (field :name "name"
               :type *string*
               :resolver (constantly "Theodor Thornhill"))
   (field :name "age"
               :type *int*
               :resolver (constantly 31))))

should be

(defparameter *fields*
  (list
   (field :name "name"
               :gql-type *string*
               :resolver (constantly "Theodor Thornhill"))
   (field :name "age"
               :gql-type *int*
               :resolver (constantly 31))))

You are absolutely correct that they are out of date, unfortunately. I'll see if I can update them this evening or so. I will also make a real list of actionable task for me and/others to work on so that it will be actually useful.

I'm struggling a bit on the coersion between nil/false/null/true problem in lisp vs js, but we'll get there :)

Also I finally have some summer holidays, so there's that :)

Thanks for your interest!

#34 Examples nolonger work 2 years ago

Ticket created by ~gavinok on ~theo/gql

Current example files are out of date. I have yet to learn the new api but at the moment at least example1.lisp is using the wrong api. For example

(defparameter *fields*
  (list
   (field :name "name"
               :type *string*
               :resolver (constantly "Theodor Thornhill"))
   (field :name "age"
               :type *int*
               :resolver (constantly 31))))

should be

(defparameter *fields*
  (list
   (field :name "name"
               :gql-type *string*
               :resolver (constantly "Theodor Thornhill"))
   (field :name "age"
               :gql-type *int*
               :resolver (constantly 31))))