- React for components
- Component definitions with co-located queries and mutations
- GraphQL for client-side state management
- GraphQL for server queries and mutations
- Prefer data over code (i.e. Hiccup-style UI definitions)
- Two-level API:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Query: A vector of keywords (e.g. [:foo :bar]) | |
(defmacro with-query-bindings | |
"Binds names derived from a query to the results for the query. | |
E.g. the query [:foo :bar] is turned into | |
(let [{foo :foo bar :bar} <query result>] | |
<body>)" | |
[query query-result & body] | |
(let [bindings (query-bindings query)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/W/w/macros (master↑1|✔) $ boot pom | |
java.lang.Thread.run Thread.java: 745 | |
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 617 | |
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1142 | |
java.util.concurrent.FutureTask.run FutureTask.java: 266 | |
... | |
clojure.core/binding-conveyor-fn/fn core.clj: 2027 | |
boot.core/boot/fn core.clj: 1030 | |
... | |
boot.core/construct-tasks core.clj: 992 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* GraphQlTag.re */ | |
type query; | |
type gql = (string => query) [@bs]; | |
external gql : string => query = "default" [@@bs.module "graphql-tag"]; | |
let gql = gql; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
"github.com/functionalfoundry/graphqlws" | |
"github.com/graphql-go/graphql" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This assumes you have access to the above subscription manager | |
subscription := subscriptionManager.Subscriptions() | |
for _, conn := range subscriptions { | |
// Things you have access to here: | |
conn.ID() // The connection ID | |
conn.User() // The user returned from the subscription manager's Authenticate | |
for _, subscription := range subscriptions[conn] { | |
// Things you have access to here: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
"github.com/functionalfoundry/graphqlws" | |
"github.com/graphql-go/graphql" | |
"github.com/graphql-go/handler" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
"github.com/functionalfoundry/graphqlws" | |
"github.com/graphql-go/graphql" | |
"github.com/graphql-go/graphql/language/ast" | |
"github.com/graphql-go/handler" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ graphql-js git:(jannis/fix-cyclic-imports) ✗ yarn test | |
yarn run v1.3.2 | |
$ npm run lint && npm run check && npm run testonly | |
> @jannispohlmann/[email protected] lint /Users/jannis/Work/oss/graphql/graphql-js | |
> eslint --rulesdir ./resources/lint src || (printf '\033[33mTry: \033[7m npm run lint -- --fix \033[0m\n' && exit 1) | |
> @jannispohlmann/[email protected] check /Users/jannis/Work/oss/graphql/graphql-js | |
> flow check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Run using a local build of ClojureScript master, e.g.: | |
;; clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.155"}}}' -i build.clj | |
(require '[cljs.build.api :as b]) | |
(b/watch "src" | |
{:output-dir "out" | |
:output-to "out/main.js" | |
:optimizations :none | |
:verbose true |