Open capndave opened 3 years ago
Assign it to me @capndave
Will do! If you would, please just set up your own account for the Trefle API, and import the connection settings into Django with an environment variable from a .env file in the config
directory. I can swap out my Trefle credentials later. Please let me know if you have any difficulties getting this up and running!
@rexdivakar let me know if you're still working on this, if not I'll unassign you
Yes I'm working on it will update it soon @capndave
hey @capndave Currently I'mpulling all the varieties of tomatoes, now i would like to know few details,
Awesome! The parameters I'd like to return to the client are { id, common_name, slug, scientific_name, image_url }
for all tomato varieties. Let me know if there are pagination issues, like if you're unable to get all varieties with one api call.
no prob, i can get it done but do u want the output in the form of list or dictionary ?
Dictionary please. Basically you'll need to make a graphql query that accepts plantName
(in the query itself) / plant_name
(in python) and returns a bunch of items of class variety
that include the parameters that you mention. The Trefle API call is just the intermediate step to actually fetch the data.
I will raise the PR soon
What do u think about dumping the data into a json file !! So we can even use it often with less network load ?
GREAT idea! I guess we could just check the .json
on each request from the client, and call Trefle if a top-level variety
key isn't in the .json
? I wonder if Redis or Memcache or something would be useful here, or overkill.
If u have a larger work load we can go with Redis or Memcache but with smaller use case we can use .json (feed files) what do u say ?
Sounds great!
In Plants app, write handler to pull data from Trefle API. Ultimately we want a user of this (gardenbuilder-backend) to write a GraphQL query, passing in a fruit or vegetable name ("Tomato", for example). This handler/function would then query all of the tomato varieties from the Treffle API, return them, and then return all the tomato varieties to the user/graphql interface.