/public/v1/get-cities/
{
"data": [
{
"id": 1,
"slug": "moskva",
"previewImage": "https://....",
"name": "Москва"
}
import telethon | |
import telethon.tl.types | |
import os | |
import json | |
import glob | |
api_id = 0 | |
api_hash = "" | |
limit = 50 |
/public/v1/get-cities/
{
"data": [
{
"id": 1,
"slug": "moskva",
"previewImage": "https://....",
"name": "Москва"
}
class JQ { | |
constructor(jq) { | |
this._jq = jq | |
} | |
sort(newSort) { | |
return {...this._jq, sort: newSort} | |
} | |
paginate(newPage) { | |
return {...this._jq, page: newPage} | |
} |
const puppeteer = require('puppeteer'); | |
const readline = require('readline-sync'); | |
const util = require('util'); | |
const fs = require('fs'); | |
const USERNAME = 'USERNAME'; | |
const EXPECTED_TEMPLATE_NAME = 'EXPECTED_TEMPLATE_NAME'; | |
const EXPECTED_ACCOUNT_NUMBER = 'EXPECTED_ACCOUNT_NUMBER'; | |
function questionAsync(text, hidden = false) { |
#!/usr/bin/env bash | |
# Фейковый npm | |
# Нужен для кэширования папки node_modules | |
# Кэш находится в папке ~/.cache/npm-inject/[sha1 хэш файла package.json]/node_modules | |
# | |
# В PATH надо добавить путь папки с фейковым npm, таким образом при выполнении команды `npm install` | |
# bash вызовет фейковый npm c параметром `install`. | |
# Фейк проверяет наличие папки [sha1 хэш файла package.json] в кэше. | |
# Если она в кэше, создаем на неё симлинк node_modules |
function loadingIndicator() { | |
return Component => { | |
return class LodingIndicator extends React.Container { | |
// static displayName = | |
constructor() { | |
super(); | |
this.state = { | |
counters: {}, | |
}; | |
} |
import { compose } from 'redux'; | |
import { connect } from 'react-redux'; | |
import { reduxForm } from 'redux-form'; | |
import { injectIntl } from 'react-intl'; | |
import { createSearchQuery } from '../../actionCreators/search'; | |
import SearchBox from './SearchBox'; | |
export default compose( |
'use strict'; | |
const CypherQuery = require('./cypher').CypherQuery; | |
module.exports = function createQueryExecutor(context) { | |
const executor = function executeQuery(query) { | |
if (typeof query === 'function') { | |
return query(executor); | |
} |
export default function marker(value) { | |
if (process.env.NODE_ENV !== 'production') { | |
return { | |
'data-marker': value, | |
}; | |
} | |
return {}; | |
} |
Features:
Relay.fetch(graphqlQuery)
returns subscribtion that could change over time by mutation queries.Relay.update(m: UpdateMutation)
optimistically updates resource in all previous queries that contains updated resource.Relay.update(m: DeleteMutation)
optimistically deletes resource from all previous queries that contains deleted resource.Relay.update(m: CreateMutation)
pessimistically creates resource and executes again all previous queries.id
key in graphql response explained as resources.
Arrays, objects without id
and scalars explained as static properties.