Skip to content
Snippets Groups Projects
Commit 30dca2f2 authored by Alexander Rose's avatar Alexander Rose
Browse files

tweaked graphql codegen to work with new version

parent aa4824a6
No related branches found
No related tags found
No related merge requests found
......@@ -5,17 +5,16 @@ const basePath = path.join(__dirname, '..', '..', 'src', 'mol-model-props', 'rcs
generate({
schema: 'http://rest-dev.rcsb.org/graphql',
documents: [
path.join(basePath, 'symmetry.gql.ts')
],
documents: {
[path.join(basePath, 'symmetry.gql.ts')]: {
loader: path.join(__dirname, 'loader.js')
},
},
generates: {
[path.join(basePath, 'types.ts')]: {
plugins: ['time', 'typescript-common', 'typescript-client']
}
},
// template: 'graphql-codegen-typescript-template',
// out: path.join(basePath),
// skipSchema: true,
overwrite: true,
config: path.join(__dirname, 'codegen.json')
}, true).then(
......
const { parse } = require('graphql');
const { readFileSync } = require('fs');
module.exports = function(docString, config) {
const str = readFileSync(docString, { encoding: 'utf-8' }).trim()
.replace(/^export default `/, '')
.replace(/`$/, '')
return [
{
filePath: docString,
content: parse(str)
}
];
};
\ No newline at end of file
// workaround so the query gets found by the codegen
function gql (strs: TemplateStringsArray) { return strs.raw.join('') }
export default
gql`query AssemblySymmetry($pdbId: String!) {
export default `query AssemblySymmetry($pdbId: String!) {
assemblies(pdbId: $pdbId) {
pdbx_struct_assembly {
id
......
// Generated in 2019-01-30T16:38:09-08:00
// Generated in 2019-03-01T14:48:33-08:00
export type Maybe<T> = T | null;
/** Built-in scalar representing an instant in time */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment