How to save settings for a plugin per graph?

Now that I know how to get graph name I can suggest a way to save specific graph settings. For instance:

const graphName = (await logseq.App.getCurrentGraph()).name;

// Write
logseq.updateSettings({[graphName]: { foo: 'Foo' }})

// Read
logseq.settings[graphName];

1 Like