From 1c2ee10ce7a32df892604846279c7e199ce0ccea Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Wed, 22 May 2019 21:46:43 +0200 Subject: graphql: Implement `Authored` whenever possible webui: Use a fragment for Authored nodes --- webui/src/Author.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'webui/src/Author.js') diff --git a/webui/src/Author.js b/webui/src/Author.js index 7bb1bf3c..237a7956 100644 --- a/webui/src/Author.js +++ b/webui/src/Author.js @@ -1,3 +1,4 @@ +import gql from 'graphql-tag'; import Tooltip from '@material-ui/core/Tooltip/Tooltip'; import MAvatar from '@material-ui/core/Avatar'; import React from 'react'; @@ -14,6 +15,17 @@ const Author = ({ author, ...props }) => { ); }; +Author.fragment = gql` + fragment authored on Authored { + author { + name + email + displayName + avatarUrl + } + } +`; + export const Avatar = ({ author, ...props }) => { if (author.avatarUrl) { return ; -- cgit