Add persisted operations to near-operation-file#899
Add persisted operations to near-operation-file#899Shane32 wants to merge 1 commit intodotansimha:mainfrom
Conversation
|
| pluginMap: { | ||
| [`persisted-operations`]: { | ||
| plugin: async () => { | ||
| //await tdnFinished.promise; |
There was a problem hiding this comment.
Cline removed this line, so I added it back as a comment. Seems like client-preset did some kind of plugin map on typed-document-node, hooking into it so that this promise would run after typed-document-node finished. Not really sure if that is applicable here or how to integrate it.
There was a problem hiding this comment.
For reference, here's the code from client-preset:
const tdnFinished = createDeferred();
const persistedDocumentsMap = new Map<string, string>();
const pluginMap = {
...options.pluginMap,
[`add`]: addPlugin,
[`typescript`]: typescriptPlugin,
[`typescript-operations`]: typescriptOperationPlugin,
[`typed-document-node`]: {
...typedDocumentNodePlugin,
plugin: async (...args: Parameters<PluginFunction>) => {
try {
return await typedDocumentNodePlugin.plugin(...args);
} finally {
tdnFinished.resolve();
}
},
},
[`gen-dts`]: gqlTagPlugin,
};
Description
Adds persisted operation support to
near-operation-file. Since I've no idea what I'm doing, I had Cline (Anthropic AI), copy functionality fromclient-presetand this is what it came up with.Related:
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Hoping someone else knows how to finish/test this PR.
Checklist:
CONTRIBUTING doc and the
style guidelines of this project
Further comments
Sorry, I don't know much about codegen plugins. Just hoping this PR will kick start some community progress. I will update this PR if/as I make any more progress.
At a minimum, this code could be used as a reference for issue #496