Skip to content

Instantly share code, notes, and snippets.

View lennyburdette's full-sized avatar

Lenny Burdette lennyburdette

  • Apollo GraphQL
  • Boston
View GitHub Profile
@lennyburdette
lennyburdette / README.md
Last active January 14, 2022 13:20
graphql-kotlin + java-dataloader with suspended functions

This gist provides wrappers around java-dataloader's classes to make them compatible with coroutines, as well as a "dispatcher" that provides a mechanism for dispatching dataloaders enqueued during a GraphQL operation execution.

Rationale

For context on why this is necessary, see [this issue on graphql-java][issue] and specifically [this comment][comment] with a solution that Apollo uses for their own GraphQL services.

The crux of the issue is that graphql-java's dataloader dispatching mechanism assumes one

@lennyburdette
lennyburdette / queryplan.graphql
Created April 8, 2020 00:35
Apollo Federation "Combine Data Stores" Query Plan
QueryPlan {
Sequence {
Fetch(service: "/sandbox/src/services/tweet-search.js") {
{
search(word: "everyday") {
id
__typename
}
}
},
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { format, parse } from '../helpers/format';
import { scheduleOnce } from '@ember/runloop';
export default class extends Component {
@tracked currencyCode = 'USD';
@tracked formattedValue;
@tracked previousRawValue;
// https://github.com/emberjs/ember.js/blob/v3.13.0-beta.3/packages/%40ember/runloop/index.js#L226
export const bind = (...curried) => {
assert(
'could not find a suitable method to bind',
(function(methodOrTarget, methodOrArg) {
// Applies the same logic as backburner parseArgs for detecting if a method
// is actually being passed.
let length = arguments.length;
if (length === 0) {
{
"sequence": {
"nodes": [
{
"fetch": {
"serviceName": "mds-graph",
"sentTimeOffset": "29502368",
"sentTime": {
"seconds": "1565031614",
"nanos": 919000000
{
"data": {
"_entities": [
{
"id": "6SYTCHY1DXG8H",
"capitalPlans": {
"nodes": [
{
"id": "10",
"status": "CLOSED"
import Ember from 'ember';
export default Ember.Component.extend({
tagName: ''
});
@lennyburdette
lennyburdette / components.my-component.js
Last active December 14, 2018 03:45
Focus In/Out DOM versus Component Methods
import Ember from 'ember';
export default Ember.Component.extend({
});
@lennyburdette
lennyburdette / gist:383321f4301e24e53e6cbe2f04381e89
Created November 25, 2018 19:17
node-grpc + envoy authority error
D1125 17:55:29.703964590 506290 dns_resolver.cc:338] Using native dns resolver
I1125 17:55:29.704114003 506290 timer_manager.cc:93] Spawn timer thread
I1125 17:55:29.704164815 506290 init.cc:153] grpc_init(void)
I1125 17:55:29.704190197 506377 timer_manager.cc:245] timers not checked: expect another thread to
I1125 17:55:29.704246139 506377 timer_manager.cc:193] sleep until kicked
I1125 17:55:29.704779204 506290 completion_queue.cc:474] grpc_completion_queue_create_internal(completion_type=0, polling_type=0)
I1125 17:55:29.760910011 506290 ssl_credentials.cc:128] grpc_ssl_credentials_create(pem_root_certs=-----BEGIN CERTIFICATE-----
*SNIP CERTIFICATE CONTENT*
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '',
actions: {
onInput(value) {
console.log(value);
if (value.match(/[^\d]/)) {
this.notifyPropertyChange('value');