Skip to content

Instantly share code, notes, and snippets.

View nodkz's full-sized avatar

Paul Damnhorns nodkz

View GitHub Profile
@wegorich
wegorich / index.ts
Last active March 5, 2020 15:01
how work with localmock client
import { from, ApolloClient, HttpLink, InMemoryCache } from '@apollo/client';
import { errorLink } from './error.link';
import * as tags from './posts.resolvers';
const typeDefs = [tags.typeDefs];
const resolvers = [tags.resolvers];
const gqlClient = new ApolloClient({
cache: new InMemoryCache(),
typeDefs,
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@sibelius
sibelius / MutationUtils.js
Created March 19, 2018 10:20
Helper methods for Relay Modern updater
// @flow
import { ConnectionHandler } from 'relay-runtime';
import { isObject, isArray } from 'lodash/fp';
export function listRecordRemoveUpdater({ parentId, itemId, parentFieldName, store }) {
const parentProxy = store.get(parentId);
const items = parentProxy.getLinkedRecords(parentFieldName);
parentProxy.setLinkedRecords(items.filter(record => record._dataID !== itemId), parentFieldName);
}
@Lendar
Lendar / App.js
Last active October 22, 2021 20:38
Using FontFaceObserver for React app loader
import React from 'react'
import 'fontfaceobserver'
import IndexPage from './IndexPage'
import Loader from './Loader'
import { fetchUser } from '../apiclient'
import 'font-awesome-webpack'
import './Lato-font.css'
import './Roboto-font.css'
@fdecampredon
fdecampredon / Container.js
Last active August 27, 2017 17:04
redux-relay
import React from 'react';
import { container } from 'redux-relay';
@container({
variablesFromState: (state) => ({myVariable: state.myState})
fragments: {
Relay.QL`
viewer {
@kekekeks
kekekeks / ru_en_analyzer
Last active April 12, 2023 15:16
russian + english analyzer for elasticsearch русский + английский
{
"settings": {
"analysis": {
"filter": {
"english_stop": {
"type": "stop",
"stopwords": "_english_"
},
"english_stemmer": {
"type": "stemmer",