コード例 #1
0
ファイル: test_global.py プロジェクト: jhgg/graphql-relay-py
def getNode(globalId, *args):
    resolvedGlobalId = fromGlobalId(globalId)
    _type, _id = resolvedGlobalId.type, resolvedGlobalId.id
    if _type == 'User':
        return userData[_id]
    else:
        return photoData[_id]
コード例 #2
0
ファイル: schema.py プロジェクト: jhgg/relaypy
def getNode(globalId, *args):
    resolvedGlobalId = fromGlobalId(globalId)
    _type, _id = resolvedGlobalId.type, resolvedGlobalId.id
    if _type == 'Faction':
        return getFaction(_id)
    elif _type == 'Ship':
        return getShip(_id)
    else:
        return None