# Intro to graphql python/strawberry

**URL:** <https://community.apollographql.com/t/intro-to-graphql-python-strawberry/7683>\
**Category:** Client SDKs\
**Tags:** client\
**Created:** [July 6, 2024, 11:23am UTC](https://community.apollographql.com/t/intro-to-graphql-python-strawberry/7683 "2024-07-06T11:23:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zach-dubroc](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/zach-dubroc/32/5215_2.png) [@zach-dubroc](https://community.apollographql.com/u/zach-dubroc)\
**Post date:** [July 6, 2024, 11:23am UTC](https://community.apollographql.com/t/intro-to-graphql-python-strawberry/7683/1 "2024-07-06T11:23:47Z")

</div>

course is great so far!  
having an issue with openapi-python-client generating the spotify-client  
when I run “openapi-python-client generate --meta none --path data/openapi.json”  
I can’t get past this error:

Error(s) encountered while generating, client was not created

ruff failed

models\spotify\_object\_authorization\_code\_credentials.py:62:22: F821 Undefined name `cast`  
models\spotify\_request\_query\_params\_get\_mefollowing.py:48:16: F821 Undefined name `cast`  
models\spotify\_request\_query\_params\_get\_search.py:69:28: F821 Undefined name `cast`  
Found 1929 errors (1926 fixed, 3 remaining).

 ![Screenshot 2024-07-06 061915](https://us1.discourse-cdn.com/flex019/uploads/apollographql/original/2X/6/6109a8408fce6b6a8edbbe16a1922c1c391994a9.png)

unsure on both ruff and what/where ‘cast’ should be?

---

<div class="post-metadata">

**Author:** ![phdye](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/phdye/32/5218_2.png) [@phdye](https://community.apollographql.com/u/phdye)\
**Post date:** [July 7, 2024, 8:15am UTC](https://community.apollographql.com/t/intro-to-graphql-python-strawberry/7683/2 "2024-07-07T08:15:27Z")

</div>

Yep, me too. It’s a great course but now I’m stuck with “Undefined name `cast`”.

Without rm -rf mock\_spotify\_rest\_api\_client, ‘cast’ does not exist in the source tree.  
% rm -rf mock\_spotify\_rest\_api\_client && grep -r cast .  
# nothing found

Environment:  
Ubuntu 22.04.4 LTS within WSL2 / Windows 11  
Python 3.12.4  
openapi-python-client version: 0.21.1  
ruff-0.4.10

Apollo GraphQL deacons, please advise us lowly acolytes.

If you need further info, please inquire.

Thanks and have a wonderful day!

---

<div class="post-metadata">

**Author:** ![phdye](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/phdye/32/5218_2.png) [@phdye](https://community.apollographql.com/u/phdye)\
**Post date:** [July 8, 2024, 4:45pm UTC](https://community.apollographql.com/t/intro-to-graphql-python-strawberry/7683/4 "2024-07-08T16:45:35Z")

</div>

I dug into this a bit further. While ruff did have a similar issue once, in this case the generated python files are missing: “from typing import cast”

SOLVED: Simply revert back to 0.18.0 version of openapi-python-client. It works fine then. Have a wonderful day!
