Skip to content

Instantly share code, notes, and snippets.

View mickdelaney's full-sized avatar

mick delaney mickdelaney

View GitHub Profile
@mickdelaney
mickdelaney / SearchUser.tsx
Created July 21, 2022 07:34 — forked from hyochan/SearchUser.tsx
react native relay pagination
import { Animated, FlatList } from 'react-native';
import React, { FC, Suspense, useState } from 'react';
import type {
SearchUsersPaginationQuery,
SearchUsersPaginationQueryResponse,
SearchUsersPaginationQueryVariables,
} from '../../__generated__/SearchUsersPaginationQuery.graphql';
import {
graphql,
useLazyLoadQuery,
@mickdelaney
mickdelaney / remove-docker-by-name-search.sh
Last active May 21, 2022 12:04
remove docker images by search name
docker rm -f $(docker ps | grep 'search-string' | awk '{print $1}')
@mickdelaney
mickdelaney / metro.config.js
Created January 8, 2022 17:19 — forked from sibelius/metro.config.js
Metro config to make react native play nice with monorepos
const path = require('path');
const getWorkspaces = require('get-yarn-workspaces');
const blacklist = require('metro-config/src/defaults/blacklist');
const workspaces = getWorkspaces(__dirname);
module.exports = {
projectRoot: path.resolve(__dirname, 'packages/app'),
@mickdelaney
mickdelaney / hotchocolate-simple-scalar-ddd
Created December 17, 2021 10:43
Hotchocolate DDD Style Value Types and Filtering
DDD Style Value Types and Filtering
Hi Guys,
I’m trying to migrate a scalar field from String to an EmailAddress class
The EmailAddress class has a String Property called ‘Value’.
As part of the GraphQL Schema there should be a way to filter the User by EmailAddress.
```csharp
@mickdelaney
mickdelaney / hotchocolate-custom-guid-id-type.cs
Last active November 22, 2021 17:11
hotchocolate custom guid id type
public interface INewTypeEq<TSelf, TValue> : IValue<TValue>, IEquatable<TSelf>
where TValue : IEquatable<TValue>
where TSelf : INewTypeEq<TSelf, TValue>
{
TSelf New(TValue value);
}
public static IRequestExecutorBuilder AddIdType<TIdType>
(
this IRequestExecutorBuilder builder,
{
"$id": "1",
"input": {
"$id": "2",
"providerName": "WorkflowInstance"
},
"output": {
"$id": "3",
"activityId": "ef0a5456-1c33-4494-9ca4-3fde95c6fa2b"
},
@mickdelaney
mickdelaney / gist:fdc99ec98cb688970391056982e56fc4
Last active September 16, 2021 09:52
elsa-iconvertible-error
public enum OrderMappingStatus
{
Pending,
Mapped,
Failed
}
public record OrderMappedModel
(
TenantId TenantId,
@mickdelaney
mickdelaney / esbuild-relay.js
Created May 5, 2021 06:07 — forked from sciyoshi/esbuild-relay.js
Esbuild plugin for compiling relay queries
import { promises } from "fs";
import crypto from "crypto";
import path from "path";
import { print, parse } from "graphql";
const plugin = {
name: "relay",
setup: build => {
build.onLoad({ filter: /\.tsx$/, namespace: "" }, async args => {
let contents = await promises.readFile(args.path, "utf8");
develop/react/react-webpack master ✗ 3h49m ✖ ⚑ ◒
▶ yarn build
yarn run v1.22.10
$ webpack --mode production
assets by status 1.06 MiB [cached] 2 assets
orphan modules 718 KiB [orphan] 133 modules
runtime modules 1.25 KiB 6 modules
modules by path ./node_modules/ 2.51 MiB
javascript modules 2.49 MiB
cacheable modules 2.49 MiB 325 modules
@mickdelaney
mickdelaney / relay.config.js
Created April 30, 2021 17:58 — forked from sibelius/relay.config.js
Relay Config that works well with monorepo, you can spread your fragments in many packages
module.exports = {
schema: './data/schema.graphql',
language: 'typescript',
src: '../.',
include: [
'./web/src/**',
'./shared/src/**',
],
};