![]() Tags admin api authentication award Azure caching cas cloud cms css Devops django djangocon golang graphene GraphQL heist html5 javascript JQuery mavericks Memcached microsoft Migrations mutations mysql pixi. Wagtail and Azure Storage Blob Containers.Wagail / Graphene Mutation with image upload example.Wagtail connecting to Azure Storage Blob Container with SAS.Getting Azure Devops IP Ranges for a specific region.Then go to headers and add the following : Schema = graphene.Schema(query=Query, mutation=Mutation,types=)įirst setup a new POST request pointing to your GraphQL endpoint, then in the Body, under form-date add a key for the file and one for the query as below : Thefile = Ĭreate_marketitem = CreateMarketItem.Field() Root_collection = Collection.get_first_root_node() Marketitem = MarketItem(title=title, description=description) ![]() ![]() This code is for Wagtail 1.13.1 and Graphene 2.0.1, graphene-django 2.0.0įrom graphene_django import DjangoObjectTypeįrom graphene import ObjectType, Field, Schemaįrom import GenericScalarįrom import Collectionįrom import ImageĬlass CreateMarketItem(graphene.Mutation):ĭef mutate(self, info, title, description): It took me a while to figure out how to use Postman to send a mutation query with a file to graphene, so hopefully this will save someone some time. For this example, first we’ll add a user Alice and some Todo’s to our application and then query them. Now we’ll see an example of how to use them in Postman. Here’s some example code of how to setup a mutation with an image file upload for a Wagtail Image field, then how to test in Postman (Postman is a useful tool for testing APIs etc) GraphQL variables allow the user to use the same query/mutation but with different inputs.
0 Comments
Leave a Reply. |