As when i try to to do api.query.templatemodule.get_something() it shows errors in the console

  • please share a screenshot or extract of the errors, and the version of substrate, substrate-template, or substrate-parachain-template, polkadot.js apps, and polkadot.js api that you're are using Feb 16, 2022 at 13:38
  • Please provide a Minimal, Reproducible Example
    – Shawn Tabrizi
    Feb 16, 2022 at 16:18

1 Answer 1


Probably the error here is due to Rust doing things with snake_case/UpperCase, and JavaScript doing things with camelCase.

I would never expect that the Polkadot JS API would expose a function which is not camelCase, so probably what you want is:


This should work fine assuming your storage is named the same thing:

pub(super) type GetSomething<T: Config> = StorageValue<_, u64, ValueQuery>;

Not the answer you're looking for? Browse other questions tagged or ask your own question.