Skip to content

Instantly share code, notes, and snippets.

**/*.{js,_js,bones,es,es6,frag,gs,jake,jsb,jscad,jsfl,jsm,jss,mjs,njs,pac,sjs,ssjs,xsjs,xsjslib,jsx,ts,tsx,json,json5,geojson,JSON-tmLanguage,topojson,css,pcss,postcss,less,scss,graphql,gql,md,markdown,mdown,mdwn,mkd,mkdn,mkdown,ron,workbook,vue}
#!/usr/bin/env bash
set -o xtrace -o errexit -o pipefail -o nounset
########################################################################################
# CircleCI's current recommendation for roughly serializing a subset
# of build commands for a given branch
#
# circle discussion thread - https://discuss.circleci.com/t/serializing-deployments/153
# Code from - https://github.com/bellkev/circle-lock-test
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.testappmaster"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.testapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.testapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />
import { GraphQLIncludeDirective, GraphQLSkipDirective } from 'graphql/type/directives';
const schema = new GraphQLSchema({
directives: [
InstrumentDirective,
GraphQLIncludeDirective,
GraphQLSkipDirective
],
query: RootQueryType
});
const resolveWithInstrumentation = (resolve) => {
return (source, args, context, info) => {
const directives = info.fieldASTs[0].directives;
const instrumentDirective = directives.filter(d => d.name.value === InstrumentDirective.name)[0];
if (!instrumentDirective) {
return resolve(source, args, context, info);
}
const start = new Date();
return Promise.resolve(resolve(source, args, context, info)).then((result) => {
const resolveWithInstrumentation = (resolve) => {
return (source, args, context, info) => {
const directives = info.fieldASTs[0].directives;
const instrumentDirective = directives.filter(d => d.name.value === InstrumentDirective.name)[0];
if (!instrumentDirective) {
return resolve(source, args, context, info);
}
// instrument the resolve
};
const resolveWithInstrumentation = (resolve) => {
return (source, args, context, info) => {
// logic
};
};
const ResultType = new GraphQLObjectType({
name : 'Result',
fields : {
text : {
type : new GraphQLNonNull(GraphQLString)
},
id : {
type : new GraphQLNonNull(GraphQLID),
resolve: resolveWithInstrumentation((result) => {
return result.id;