Comments (3)
import requests
from graphql_query import Argument, Directive, Field, Operation, Query, Variable
dd = 'str1 str2 str3 str4 str5 str6'
class demo:
def getData(self, sort_field, reverse, data_type, input):
get_asset = Query(
name="get_data",
arguments=[Argument(name="sort_field", value=sort_field),
Argument(name="reverse", value=reverse),
Argument(name="data_type", value=data_type),
Argument(name="input", value=input),
],
fields=[
Field(name="color", fields=[dd]),
Field(name="count")
]
)
operation = Operation(type="", queries=[get_asset])
return operation.render()
def result(self):
return {
"query": self.getData(sort_field='"green",', reverse='false,', data_type='"red",',
input='["a","b","c","d","e","f"],')
}
print(demo().result())
data = demo().result()
your_url = ''
your_header = {}
# method 1
r = requests.post(url=your_url, json=data, headers=your_header)
print(r.status_code)
print(r.json())
# def test_query():
# # method 2
# r = requests.post(url=your_url, json=data, headers=your_header)
# print(r.status_code)
# print(r.json())
'''
Replace with your URL, header, and parameters
then apply Method 1 and Method 2 separately.
Method 1 succeeds, while Method 2 results in an error.
Python 3.11.5
pytest 7.4.2
pydantic 2.5.3
pydantic_core 2.14.6
graphql_query 1.2.0
'''
from graphql-query.
Hello, thank for report of this bug!
I will check this problem soon. Can you give an example of a test with this error?
What are the versions of your requirements (python, pytest, pydantic, graphql-query)?
from graphql-query.
The following PR fixed your problem #32
Available in version 1.3.0 https://github.com/denisart/graphql-query/releases/tag/v1.3.0
from graphql-query.
Related Issues (7)
- Cannot render list of strings Argument. HOT 1
- Quotes are stripped from list of strings in Argument HOT 3
- Add functionality to pass context while rendering HOT 2
- The Argument does not allow to add a Float type HOT 1
- Comment in query or mutation HOT 1
- [Question] How to render query with no fields selection? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-query.