Bloomberg.com
Infrastructure Background
Daper (Web Shared Services)
Business
Politics
Markets
View
Gadfly
Daper (Web Shared Services)
Infrastructure Background
Business
Politics
Markets
View
Gadfly
Daper (Web Shared Services)
Bbiz
SA
Pol
SA
Mar
SA
Gadfly
SA
Infrastructure Background
Bloomberg.com Web
Daper (Web Shared Services)
Bbiz
SA
Pol
SA
Mar
SA
Gadfly
SA
Bloomberg.com Web
Bloomberg Mobile Apps
Infrastructure Background
Daper (Web Shared Services)
Universal Service Adapter (Wardenclyffe)
Bloomberg.com Web
Bloomberg Mobile Apps
Articles
Market
Data
Curated Pages
Infrastructure Background
Bloomberg.com Web
type Article {
id: String
headline: String
summary: String
authors: [Person]
}{
article(id: "P3C1C16JTSEA01") {
headline
summary
}
}{
"data": {
"article": {
"headline": "Elon Musk is Selling Flamethrowers",
"summary": "The bizarre side venture has already
generated $5 million for his tunnel business."
}
}
}
Introduction to GraphQL
Introduction to GraphQL
GraphQL at Bloomberg
Store
Schema
Model
GraphQL at Bloomberg
import { GraphQLString, GraphQLNonNull } from 'graphql';
import SecurityCategory from './model';
export default {
type: SecurityCategory,
args: {
id: { type: new GraphQLNonNull(GraphQLString) },
},
resolve: async (_, { id }, Store) => {
const category = await Store.Securities.findCategoryById(id);
return { ...category, id };
},
};
GraphQL at Bloomberg
import { GraphQLObjectType, GraphQLString } from 'graphql';
export default new GraphQLObjectType({
name: 'SecurityCategory',
fields: () => ({
id: { type: GraphQLString },
type: { type: GraphQLString },
terminalSecurityType: { type: GraphQLString },
mediaSecurityType: { type: GraphQLString },
mediaSecuritySubtype: { type: GraphQLString },
}),
});
GraphQL at Bloomberg
import securityCategories from './data/security/categories.json';
import { translateFields, getCalcrts } from './data/security/helper';
const securityCategoryFields = Object.keys(securityCategories)
.map(key => securityCategories[key])
.join(',');
async function getSecurityCategory(daper, id) {
const params = { securities: id, fields: securityCategoryFields };
const resource = await daper.resource(['finance', 'reference'], { params });
const { data } = resource.toJSON();
return translateFields(data[id], securityCategories);
}
export default function createStore(daperClient) {
return {
findCategoryById: (id) => getSecurityCategory(daperClient, id)
};
}
GraphQL at Bloomberg
GraphQL at Bloomberg
Future Improvements
Right now for many calls, regardless of how few fields are in the request schema, all fields are requested from upstream
If we instead only request fields being requested, this shrinks our request sizes substantially
Future Improvements
In lieu of the previous idea (or maybe in addition to if done carefully), we could also cache at the Wardenclyffe-tier for common shared calls.
Right now Wardenclyffe expects the consuming application to cache all data themselves, and provides no support.
Future Improvements