diff options
Diffstat (limited to 'app/assets/javascripts/static_site_editor/graphql/resolvers/file.js')
-rw-r--r-- | app/assets/javascripts/static_site_editor/graphql/resolvers/file.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/assets/javascripts/static_site_editor/graphql/resolvers/file.js b/app/assets/javascripts/static_site_editor/graphql/resolvers/file.js new file mode 100644 index 00000000000..16f176581cb --- /dev/null +++ b/app/assets/javascripts/static_site_editor/graphql/resolvers/file.js @@ -0,0 +1,11 @@ +import loadSourceContent from '../../services/load_source_content'; + +const fileResolver = ({ fullPath: projectId }, { path: sourcePath }) => { + return loadSourceContent({ projectId, sourcePath }).then(sourceContent => ({ + // eslint-disable-next-line @gitlab/require-i18n-strings + __typename: 'File', + ...sourceContent, + })); +}; + +export default fileResolver; |