Skip to content

How to test extensions on federated types? #1924

Answered by dariuszkuc
terminalnode asked this question in Q&A
Discussion options

You must be logged in to vote

Hello 👋
It sounds like you are asking is how to test entities? In order to be able to hit myField you need an instance of your type which is resolved through _entities query -> at a minimum you would need to construct a schema and then you can manually execute entities query, e.g. executing query like this

query ($representations: [_Any!]!) {
    _entities(representations: $representations) {
        ...on User { 
            myField
        }
}

with variables

{
    "representations": [
        {
            "__typename": "User",
            "id": 123
        }
    ]
}

Currently it is not great user experience so if you have any ideas how to improve it let us know! We (Apollo) are looking…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@terminalnode
Comment options

@dariuszkuc
Comment options

Answer selected by terminalnode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants