Skip to content

Instantly share code, notes, and snippets.

@jbaxleyiii
Last active March 29, 2018 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbaxleyiii/f3839bfd6d122a04a7b9096cd0c5fb57 to your computer and use it in GitHub Desktop.
Save jbaxleyiii/f3839bfd6d122a04a7b9096cd0c5fb57 to your computer and use it in GitHub Desktop.
const videoAssetWithDuration = {
args: (source, args, context, info) => ({ id: source.id }),
fetcher: (id) => fetch(`/api/v1/assets/${id}`),
definition: gql`
fragment VideoAssetWithDuration($id: ID) on Asset {
title
description
metdata {
date
info
}
... on VideoAsset {
duration
}
}
`,
resolvers: {
metadata: (source) => source.Metadata
}
}
@jbaxleyiii
Copy link
Author

jbaxleyiii commented Mar 17, 2018

class VideoAssetWithDuration extends RestConnector {
  static definition = gql`
    fragment VideoAssetWithDuration($id: ID) on Asset {
      title
      description
      ... on VideoAsset {
        duration
      }
    }
  `;

  static resolvers = {
    metadata: (source) => source.Metadata
  };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment