Parses jq-inspired concise object access & transformation syntax using chevrotain
- Object member access:
.bar.baz
- Array member access:
.[0]
- Slices:
.[0:9]
- Construction of objects and arrays:
{a: .b.c}
,{b: .[0].foo}
,[.a.b, .c.d]
import sql, { Database } from "@leafac/sqlite"; | |
import { g, InferResolvers, buildSchema } from 'garph' | |
import { createYoga, YogaInitialContext } from 'graphql-yoga' | |
import { createServer } from 'http' | |
import { groupBy } from "lodash" | |
import { Generated, Kysely, SqliteDialect } from 'kysely' | |
// Create in memory db instance | |
const db = new Database(":memory:"); |
import { render } from "react-dom"; | |
import { factoryMap } from "./react-elfac"; | |
import App from "./App"; | |
// Use factoryMap to wrap one or more imported components | |
const R = factoryMap({ | |
App | |
}); |
// Ref: https://github.com/mobxjs/mobx-state-tree/issues/1516 | |
import { flow } from "mobx-state-tree"; | |
interface PromiseWrapper<T> { | |
_type: "PromiseWrapper"; | |
resolve: (result: T) => void; | |
reject: (err: any) => void; | |
originalPromise: Promise<T>; | |
wrappedPromise: Promise<T>; |
const { mapSchema } = require("greldal"); | |
const { graphql, GraphQLString } = require("graphql"); | |
const customOperation = { | |
operationType: "query", | |
name: "printHello", | |
fieldConfig: { | |
type: GraphQLString, | |
description: "Prints hello", | |
resolve: (obj, args, context, info) => { |
const { mapSchema } = require("greldal"); | |
const { graphql, GraphQLString } = require("graphql"); | |
const customOperation = { | |
operationType: "query", | |
name: "printHello", | |
fieldConfig: { | |
type: GraphQLString, | |
description: "Prints hello", | |
resolve: (obj, args, context, info) => { |
{ | |
"latest-preset": { | |
"t": "dracula", | |
"bg": "transparent", | |
"wt": "sharp", | |
"wc": true, | |
"fm": "Fira Code", | |
"fs": "11px", | |
"ln": false, | |
"ds": true, |
{ | |
"main": "server/index.js", | |
"scripts": { | |
"dev": "nodemon --watch server server/index.js", | |
"build": "next build", | |
"start": "NODE_ENV=production node server/index.js" | |
}, | |
"dependencies": { | |
"apollo-boost": "^0.1.13", | |
"apollo-server": "^2.0.4", |
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(show-paren-mode t) | |
'(tool-bar-mode nil) | |
'(tooltip-mode nil)) | |
(custom-set-faces | |
;; custom-set-faces was added by Custom. |