import {
  GraphQLInt,
  GraphQLList,
  GraphQLObjectType,
  GraphQLString
} from "graphql"

const RSBuddyType = new GraphQLObjectType({
  name: "RSBuddy",
  description: "Financial data retrieved from the RSBuddy/OSBuddy API",
  fields: () => ({
    ts: {
      type: GraphQLString
    },
    buyingPrice: {
      type: GraphQLInt
    },
    buyingCompleted: {
      type: GraphQLInt
    },
    sellingPrice: {
      type: GraphQLInt
    },
    sellingCompleted: {
      type: GraphQLInt
    },
    overallPrice: {
      type: GraphQLInt
    },
    overallCompleted: {
      type: GraphQLInt
    }
  }),
  resolve: root => Item.findOne({ id: root.id }, { rsbuddy: true })
})

export default RSBuddyType

@@ -1,679 +1,185 @@
-import %7B%0A  GraphQLInt,%0A  GraphQLList,%0A  GraphQLObjectType,%0A  GraphQLString%0A%7D from %22graphql%22%0A%0Aconst RSBuddyType = new GraphQLObjectType(%7B%0A  name: %22RSBuddy%22,%0A  description: %22Financial data retrieved from the RSBuddy/OSBuddy API%22,%0A  fields: () =%3E (%7B%0A    ts: %7B%0A      type: GraphQLString%0A    %7D,%0A    buyingPrice: %7B%0A      type: GraphQLInt%0A    %7D,%0A    buyingCompleted: %7B%0A      type: GraphQLInt%0A    %7D,%0A    sellingPrice: %7B%0A      type: GraphQLInt%0A    %7D,%0A    sellingCompleted: %7B%0A      type: GraphQLInt%0A    %7D,%0A    overallPrice: %7B%0A      type: GraphQLInt%0A    %7D,%0A    overallCompleted: %7B%0A      type: GraphQLInt%0A    %7D%0A  %7D),%0A  resolve: root =%3E Item.findOne(%7B id: root.id %7D, %7B rsbuddy: true %7D)%0A%7D)
+const RSBuddy = %60%0A%09type RSBuddy %7B%0A%09%09ts: String%0A%09%09buyingPrice: Int%0A%09%09buyingCompleted: Int%0A%09%09sellingPrice: Int%0A%09%09sellingCompleted: Int%0A%09%09overallPrice: Int%0A%09%09overallCompleted: Int%0A%09%7D%0A%60
 %0A%0Aex
@@ -202,9 +202,5 @@
 uddy
-Type
 %0A

Convert RSBuddy type declaration to Apollo