小编Lea*_*lzi的帖子

如何在python-gql中使用变量?

这个函数将返回所有用户而不是给定的用户名,我怎么能做对?还有更好的 Python GraphQL 客户端吗?gql 就这么简单,没有多少文件可以检查。

    def fetch_user(username):
        query = gql("""
                    query getUser($username: String) {
                    user(
                        where: { name: { _eq: $username } }
                    ) {
                        id
                        name
                    }
                    }
                """)
        result = client.execute(query)
Run Code Online (Sandbox Code Playgroud)

graphql graphql-python

0
推荐指数
1
解决办法
2304
查看次数

标签 统计

graphql ×1

graphql-python ×1