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
const logEmail = (email: Email) => console.log(email); | |
logEmail("123"); | |
/* | |
^^^^^^^^^^^^^^^ | |
Argument of type '"123"' is not assignable to parameter of type 'string & { readonly Email: unique symbol; }'. | |
Type '"123"' is not assignable to type '{ readonly Email: unique symbol; }'. | |
*/ |
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
export type Scalars = { | |
ID: string; | |
String: string; | |
Boolean: boolean; | |
Int: number; | |
Float: number; | |
Email: string & { readonly Email: unique symbol }; | |
}; | |
export type Node = { |
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
overwrite: true | |
schema: 'localhost:8000/graphql' | |
documents: '**/*.graphql' | |
generates: | |
genaratedSchema.tsx: | |
plugins: | |
- add: '// THIS IS A GENERATED FILE' | |
- typescript | |
- typescript-operations | |
config: |
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
export type Scalars = { | |
ID: string; | |
String: string; | |
Boolean: boolean; | |
Int: number; | |
Float: number; | |
Email: any; | |
}; | |
export type Node = { |
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
export type Scalars = { | |
ID: string; | |
String: string; | |
Boolean: boolean; | |
Int: number; | |
Float: number; | |
}; | |
export type Node = { | |
id: Scalars["ID"]; |
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
image: my-public-image # any image you want | |
pipelines: | |
pull-requests: | |
'**': | |
- step: | |
name: Unit Test and Build | |
caches: | |
- node | |
script: |
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
[@bs.new] external makeFormData: unit => Fetch.formData = "FormData"; | |
[@bs.send] | |
external appendFormData: (Fetch.formData, string, string) => unit = "append"; | |
let formData = makeFormData(); | |
appendFormData(formData, "field1", "value1"); | |
appendFormData(formData, "field2", "value2"); | |
appendFormData(formData, "field3", "value3"); |
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
type username = string; | |
type state = {userName: option(username)}; | |
type action = | |
| SetUserName(option(username)); | |
/* Webapi: https://github.com/reasonml-community/bs-webapi-incubator */ | |
let redirectToLogin = () => { | |
let currentUrl = Webapi.Dom.location |> Webapi.Dom.Location.href |> Js.Global.encodeURIComponent; |
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
/* Keycloak V2 */ | |
type keycloak; | |
type init; | |
type initParam; | |
[@bs.module] external keycloak : string => keycloak = "keycloak-js"; | |
[@bs.obj] external makeInitParam : (~onLoad: string, unit) => initParam = ""; | |
[@bs.send] external init : (keycloak, initParam) => Js.Promise.t(bool) = ""; | |
let myConfig = "./keycloakConfig.json"; |
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
type state = { | |
isAuthed: bool | |
}; | |
type action = | SetAuthenticated(bool); | |
let component = ReasonReact.reducerComponent("KeycloakApp"); | |
let make = (_children) => { | |
...component, |
NewerOlder