MCPcopy
hub / github.com/hasura/graphql-engine / add_spec

Function add_spec

server/tests-py/validate.py:492–517  ·  view source on GitHub ↗
(file, conf)

Source from the content-addressed store, hash-verified

490 should_write_back = False
491
492 def add_spec(file, conf):
493 spec = None
494 response = conf.get('response')
495
496 status = conf.get('status')
497 if status is None:
498 status = 200
499
500 query = conf["query"]
501 if "query" in query:
502 query = query["query"]
503
504 headers = conf.get("headers")
505
506 spec = PortToHaskell.PostSpec(
507 conf.get("description"),
508 file,
509 conf["url"],
510 headers,
511 query, # TODO: handle variables
512 status,
513 response)
514
515 PortToHaskell.with_test(hge_ctx.request.cls.__qualname__).add_spec(
516 hge_ctx.request._pyfuncitem.originalname,
517 spec)
518
519 with open(f, 'r+') as c:
520 # ruamel will preserve order so that we can test the JSON ordering

Callers 1

check_query_fFunction · 0.85

Calls 2

add_specMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected