Skip to content

Instantly share code, notes, and snippets.

View takashimamorino's full-sized avatar
🐣

takashimamorino takashimamorino

🐣
View GitHub Profile
@takashimamorino
takashimamorino / use-graphql-scalars.md
Last active January 18, 2022 01:58
GraphQL Scalars を使う

GraphQL Scalars を使う

スカラ型

スカラ型とは、いくつかの種類がある GraphQL の型において最もプリミティブな値を表すものである。 組み込みスカラとカスタムスカラがある。

組み込みスカラ

以下の 5 種類の組み込みスカラが用意されている

技術書

  • Go言語でつくるインタプリタ
  • 暗号と認証のしくみと理論がこれ1冊でしっかりわかる教科書
  • プログラミングRust
  • ブロックチェーン技術概論
  • プロを目指す人のためのTypeScript入門
  • Googleのソフトウェアエンジニアリング
  • 超速! Webページ速度改善ガイド

技術書以外

@takashimamorino
takashimamorino / codegen-scalars-option.md
Last active January 18, 2022 01:59
[memo] codegen の scalars オプションに graphql-scalars で定義している scalar type を一括で定義できるようにする

やりたいこと

Urigo/graphql-scalars の scalr type を codegen の scalrs オプションにひとつずつ登録するのがめんどくさい これをまとめて登録したい

  scalars:
    JWT: string
    EmailAddress: string
@takashimamorino
takashimamorino / typescript-tips.md
Last active May 1, 2022 03:22
TypeScript の Tips

typeof で値から型を作る

const commands = ['foo', 'bar', 'hoge'] as const;
type Command = typeof commands[number];

keof typeof 変数

Golang

構造体を定義して、関数の引数に渡す

golang には名前付き引数がない

func main() {
	MyFunc(MyFuncOpts{
 X: "x",