After going full circle on @oneField
directive -> tagged type
-> back again, the
GraphQL Input Unions Working Group have determined that our current best
proposal is to add a variant of the existing input object type that accepts
only one field, and a variant of object fields that accept only one argument.
Though the changes to introspection for this are likely to be relatively small
(e.g. adding something like __Type.isOneOf: Boolean
and `__Field.isOneOf:
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 symbols = []; | |
for (let i = 0; i < 1000; ++i) { | |
symbols[i] = Symbol(`key_${i}`); | |
//symbols[i] = `key_${i}`; | |
} | |
function test1() { | |
const map = new Map(); | |
for (let i = 0; i < 10000; ++i) { |
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
SELECT | |
pg_size_pretty(total_bytes) AS total, | |
pg_size_pretty(index_bytes) AS index, | |
pg_size_pretty(toast_bytes) AS toast, | |
pg_size_pretty(total_bytes - index_bytes - toast_bytes) AS table | |
FROM ( | |
SELECT | |
pg_total_relation_size(c.oid) AS total_bytes, | |
pg_indexes_size(c.oid) AS index_bytes, | |
coalesce(pg_total_relation_size(reltoastrelid), 0) AS toast_bytes |
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 arr = []; | |
const ARRAY_SIZE = parseInt(process.argv[2], 10) || 10; | |
const RUNS = Math.ceil(1000000000 / ARRAY_SIZE); | |
console.log(`Performing ${RUNS} runs of arrays with ${ARRAY_SIZE} elements`); | |
for (let i = 0; i < ARRAY_SIZE; i++) arr[i] = i; | |
function runTest(name, testFunction) { | |
if (global.gc) global.gc(); |
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
-- This is a compiled version of the PostGraphile introspection query. | |
-- The query that would actually run may differ from this based on | |
-- what version of PostgreSQL you're running and what your PostGraphile | |
-- options are. | |
-- @see https://www.postgresql.org/docs/9.5/static/catalogs.html | |
-- @see https://github.com/graphile/graphile-engine/blob/master/packages/graphile-build-pg/src/plugins/introspectionQuery.js | |
-- | |
with | |
accessible_roles(_oid) as ( |
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
import type { Plugin } from "graphile-build"; | |
const makeDeprecateTypePlugin = (typeName: string, deprecationReason: string): Plugin => builder => { | |
builder.hook('GraphQLObjectType:fields:field', (field, { graphql }) => { | |
if (graphql.getNamedType(field.type).name !== typeName) { | |
return field; | |
} | |
return { | |
...field, | |
deprecationReason, |
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 { promises: fsp } = require("fs"); | |
async function main(name) { | |
const content = await fsp.readFile(`./${name}.test.ts.snap`, "utf8"); | |
const lines = content.split("\n"); | |
const results = {}; | |
let header = ""; | |
for (let lineNumber = 0; lineNumber < lines.length; lineNumber++) { | |
const line = lines[lineNumber]; | |
if (line.startsWith("//")) { |
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
{ | |
"pgSettings": { | |
"search_path": "app_public,app_private,app_hidden,public" | |
}, | |
"placeholders": { | |
":DATABASE_AUTHENTICATOR": "!ENV", | |
":DATABASE_VISITOR": "!ENV" | |
}, | |
"afterReset": [ | |
"afterReset.sql", |