
Research
Security News
Malicious npm Packages Target BSC and Ethereum to Drain Crypto Wallets
Socket uncovered four malicious npm packages that exfiltrate up to 85% of a victim’s Ethereum or BSC wallet using obfuscated JavaScript.
Generate a Shopify agent on the fly thanks to Llama and LSD.
Clone the repo
Run uv run main.py
Answer prompt
Now you have an agent.rb
file
Gumroad recently went open source to support AI writing Ruby code. In order to assist the initiative towards a more AI-infused world, we gathered the Shopify GraphQL spec plus code examples to make it easy to generate Shopify agents.
The official Shopify MCP server explicitly prompts to not interact with the storefront or functions APIs. If there is a specific dataset you're interested in that wouldn't bother Shopify, then feel free to file an issue.
If you're interested in the Shopify GraphQL being programmatically accessible, the two files you'd be most interested in are:
api/models.py
-> Where the Pydantic models for the derived GraphQL operations are definedshopify_api.json
-> Where the Shopify GraphQL spec can be viewed as a JSON with code examples included.
ShopifyAPI
objectget_data
in main.py
$ git clone https://github.com/lsd-so/Shopify-GraphQL-Spec.git
main.py
file file to print_data()
instead of gen_agent()
def main():
- # get_data()
+ get_data()
- get_data()
+ # gen_agent()
# print_data()
main.py
file at the root of the project.$ uv run main.py
If you'd like to get the data yourself or update to match a new version of the Shopify API, then continue reading to learn how.
LLMs are already familiar with GraphQL so this gives them the ability to understand Shopify's GraphQL specifically.
models.py
file in api/
!LSD_USER
and LSD_API_KEY
environment variables using your authenticated credentials.$ export LSD_USER='your@email.domain'
$ export LSD_API_KEY='<api key from profile>'
$ git clone https://github.com/lsd-so/Shopify-GraphQL-Spec.git
main.py
file file to get_data()
instead of gen_agent()
def main():
- # get_data()
+ get_data()
- gen_agent()
+ # gen_agent()
# print_data()
$ uv run main.py
And there ya go.
When running this python project, it involves querying the same page more than once for different groups of elements (such as in here or here). To prevent overloading Shopify's servers, pages in distinct states (whether statically off a public URL or following a sequence of deterministic interactions) are specifically cached for up to 15 minutes on LSD for scenarios like this.
Think of LSD as a language with caching that provides a more developer friendly Wayback machine. Follow us on Twitter to stay tuned!
FAQs
Add your description here
We found that shopify-graphql demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket uncovered four malicious npm packages that exfiltrate up to 85% of a victim’s Ethereum or BSC wallet using obfuscated JavaScript.
Security News
TC39 advances 9 JavaScript proposals, including Array.fromAsync, Error.isError, and Explicit Resource Management, which are now headed into the ECMAScript spec.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.