Skip to content

Instantly share code, notes, and snippets.

View mshick's full-sized avatar
💭
🥇

Michael Shick mshick

💭
🥇
View GitHub Profile
import {
FieldNode,
OperationDefinitionNode,
SelectionNode,
SelectionSetNode,
getVisitFn,
Kind,
ASTNode,
DocumentNode,
visit,
@mshick
mshick / parameters.md
Last active October 19, 2021 16:08
parameters-play-schema

Queries

Rick characters

{
  Rick_characters {
    status
    firstName
    lastName
@mshick
mshick / python-slice-array.ts
Created October 4, 2021 17:08
python-slice-array
/**
* Accomodating the JSONPath array range syntax, this is similar to the Python
* slice function
*/
export function sliceArray<T = unknown>(
arr: T[],
start?: number,
stop?: number,
step = 1
): T[] {
@mshick
mshick / remote-schema.ts
Created October 7, 2021 20:16
remote-schema-graphql-tools
/* istanbul ignore file */
import got from "got";
import { print } from "graphql";
import {
introspectSchema,
RenameRootFields,
RenameTypes,
} from "@graphql-tools/wrap";
@mshick
mshick / loops.md
Last active October 12, 2021 15:01
fabric-query-translation

Loops

Loops are tricky. Some different scenarios below.

Nested loops

Proposal, a $loop stack, instead of the simpler variable we have now. Pretty crucial, easy change.

let $lastStep = {
@mshick
mshick / notes.md
Last active October 21, 2021 17:47
nested-ops

Nest Ops Notes

Sample Query - Rick and Morty

{
  Rick_characters {
    results {
      firstName
 lastName
@mshick
mshick / queries.md
Last active November 4, 2021 16:56
parameter-config

Queries for PR3178

Testing AWS Lambda

{
  helloWorld(value: "HELLO", functionName: "pr3178-hello-world") {
    value
  }
}
@mshick
mshick / examples.md
Last active November 8, 2021 22:12
fabric-schema-examples
{
  "results": {
    "ops": [
      {
        "path": "items[0:4]",
        "mapping": "$firstResolver.data.version[0].components"
      },
      {
 "path": "items[0:4].items",
@mshick
mshick / queries.md
Last active November 10, 2021 21:05
openapi-updates

Single Customer

Makes use of path ops and path template.

{
  Stripe_getCustomersCustomer(customer: "cus_Jtvm4LSm8CA3Qf") {
    ... on Stripe_Customer {
      id
 name
@mshick
mshick / queries.md
Last active November 17, 2021 21:35
ignoreErrors PR

Working query

{
  getCharacter(id: "1") {
    name
  }
}