私は非常に単純なフラスコのgraphqlアプリを持っており、すべてがアスペクトどおりに機能し、ブラウザから呼び出すことができ、指定されたデータを返します。
しかし、「&」を含む文字列を送信すると、常に「Syntax Error GraphQL (1:22) Unterminated string \n\n1: (...) \n ^\n」というメッセージが表示されます。
ブラウザは、指定された文字列を分割して、それをパラメータとして扱いました。
これを処理するための回避策はありますか?
#!/usr/bin/env python3
import flask
import flask_graphql
import graphene
app = flask.Flask('graphql-test')
class Query(graphene.ObjectType):
helloz = graphene.String(text=graphene.String())
def resolve_helloz(self, info, text):
return text
@app.route('/')
def index():
# Create graphql view with the authentication passed as context
return flask_graphql.GraphQLView.as_view(
'index',
schema=graphene.Schema(query=Query),
graphiql=False
)()
if __name__ == '__main__':
# Run application
app.run(host='127.0.0.1', port='8001')