Tag: python
-
GraphQL Queries Per App in Django (Graphene)
0 I started moving my REST API endpoints to using GraphQL with Graphene. Seems pretty straightforward so far, but one of the things that I like about the REST API (and I cannot figure out in Graphene) is the structure of "endpoints" for each app. I have a lot of apps in my Django application,…
-
Why do trigonometric functions give a seemingly incorrect result?
12 When attempting to use a trigonometric function in my programming language, I get a seemingly wildly incorrect result. For example, sin(90) = 0.8939966636005579 But I would expect sin(90) to be 1. What is going on and what can I do to fix this? language-agnostic trigonometry Share Follow edited 1 hour ago Bergi 638k149149 gold…
-
aiohttps: ValueError: Newline or carriage return character detected in HTTP status message or header. This is a potential security issue
0 I am using gql to run a query against a GraphQL API. I get this error: File "<path to poetry venv>/lib/python3.10/site-packages/aiohttp/http_writer.py", line 129, in write_headers buf = _serialize_headers(status_line, headers) File "aiohttp/_http_writer.pyx", line 132, in aiohttp._http_writer._serialize_headers File "aiohttp/_http_writer.pyx", line 116, in aiohttp._http_writer._safe_header ValueError: Newline or carriage return character detected in HTTP status message or header.…
-
Strawberry with social_django
0 How can I use social_django with strawberry graphql? With graphene, I inherited my strawberry.type from SocialAuthJWT I used in grapgene like this. class SocialAuth(graphql_social_auth.SocialAuthJWT): user = graphene.Field(UserType) @classmethod def resolve(cls, root, info, social, **kwargs): social.user.is_verified = True social.user.save() token = get_token(social.user) return cls(user=social.user, token=token) I’d like to log in with google. python python-3.x django…
-
Dynamic Python Function Generation from GraphQL Schema for API Requests
0 I’m looking for a method to dynamically generate Python functions that correspond to the queries and mutations defined in a GraphQL schema. After obtaining the schema, I want a system that can automatically create these functions, so I can simply import the generated code into my Python project and call the functions with the…
-
graphene federation causing dependency issue
0 Trying to use Flask-GraphQL, graphene, starlette-graphene3 and graphene-federation to integrate python code with an existing graphql server. The code worked before trying to install graphene-federation. Other trys have meant pip unable to resolve dependencies. Packages before installing federation and graphql IDE runs locally. Flask==1.0.2 Flask-GraphQL==2.0.0 graphene==2.1.3 graphql-core==2.1 graphql-relay==0.4.5 graphql-server-core==1.1.1` If I install graphene-federation then…
-
Shopify GraphQL : How To Know Sales Channels ID And Mutaion To Add A New Prodcut
0 I want to create prodcut with sales channel ID using Python and GraphQL API on Shopify. sales channel example But I don’t know how to know sales channel ID for first. So, please tell me how to get to know sales channel ID using GQL query and then if possible, tell me how to…
-
POST body not visible in OpenAPI for GraphQL route
-1 I have a FastAPI app with Strawberry for GraphQL. This is a minimal, workable example: main.py: import strawberry from fastapi import FastAPI from strawberry.fastapi import GraphQLRouter @strawberry.type class User: name: str age: int @strawberry.type class Query: @strawberry.field def user(self) -> User: return User(name="Patrick", age=100) schema = strawberry.Schema(query=Query) graphql_app = GraphQLRouter(schema) app = FastAPI() app.include_router(graphql_app,…
-
Shopify GraphQL: How to add variants using Python and GraphQL
0 I’ve been trying to create product with variants using Python and GQL, but lacking something and dosen’t work as I want. it says "Field ‘optionValues’ doesn’t exist on type ‘ProductOption’" but I reffer to a official document and copy it https://shopify.dev/docs/api/admin-graphql/2023-10/mutations/productcreate#examples-Create_a_product_with_options_and_option_values import requests import json # Shopify API credentials shop_url = "ShopURL" access_token =…