cic-internal-integration/apps/cic-eth/cic_eth/graphql/helpers.py

89 lines
1.6 KiB
Python
Raw Normal View History

2021-11-01 11:56:12 +01:00
from cic_eth.graphql.schema import schema
2021-11-01 08:48:05 +01:00
query_with_argument = """
{
defaultToken{
symbol
}
}
"""
# result = schema.execute(query_with_argument)
# print(result)
mutation_with_argument = """
mutation {
createAccount(password:"test"){
address
}
}
"""
m_result = schema.execute(mutation_with_argument)
print(m_result)
mutation_with_argument = """
mutation {
createAccount(password:"test"){
address
}
}
"""
m_result = schema.execute(mutation_with_argument)
print(m_result)
balance_query = """
query {
2021-11-01 11:56:12 +01:00
balance(address:"0x643c99d5ab51b5e06d55a68e6b24fd36e9d6b1c9", tokenSymbols:["GFT", "COFE"]){
2021-11-01 08:48:05 +01:00
balanceNetwork
balanceIncoming
balanceOutgoing
balanceAvailable
}
}
"""
2021-11-01 11:56:12 +01:00
balance_query_result = schema.execute(balance_query)
print(balance_query_result)
2021-11-01 08:48:05 +01:00
transfer_mutation = """
mutation {
transfer(fromAddress :"0xcf41bd087b71c72d748fe2b8b4c88b2367c37df3",
toAddress: "0x63474da1a315f9abe0999b6adb61ae8a9ea19a76"
value: 20
tokenSymbol: "COFE" ){
test
}
}
"""
2021-11-01 11:56:12 +01:00
# transfer_mutation_result = schema.execute(transfer_mutation)
# print(transfer_mutation_result)
2021-11-01 08:48:05 +01:00
balance_query = """
query {
balance(address:"0x63474da1a315f9abe0999b6adb61ae8a9ea19a76", tokenSymbols:["GFT"]){
balanceNetwork
balanceIncoming
balanceOutgoing
balanceAvailable
}
}
"""
# balance_query_result = schema.execute(balance_query)
# print(balance_query_result)
transactions_query = """
query {
transactions(address:"0xcf41bd087b71c72d748fe2b8b4c88b2367c37df3")
}
"""
# transactions_query_result = schema.execute(transactions_query)
# print(transactions_query_result)