There is an element of truth to this, especially if you don't have leverage. I've been there, too. Actually, there are two risks:
- People (co-workers AND management) may cynically use you for the tasks that are menial, messy and boring and doesn't lead anywhere. You become the tech equivalent of a janitor or secretary.
- People who see only one side of you think that that side is your only skill, not something you're able to in addition to your primary skillset.
In both cases, if you decide to assume the role of a generalist but want to avoid these risks, you have to spend some effort to position yourself.
These are the steps I would recommend:
1. When describing yourself, do emphasize the generalism. I tend to claim that I can do almost anything as long as it is technical, but I do some things quite slowly. In particular you need to communicate this with your manager.
2. Make sure you demonstrate the skills in the sides you have that you want to spend more time on. This means to volunteer for tasks of this type, and make sure to overperform on these tasks and market the result to decision-makers. This is perhaps the most crucial part, as it includes demonstrating an ability to show initiative and work independently.
3. Let people know that your time is valuable and costly. With managers you need to demonstrate that you can produce more value for them if they don't let you get stuck into something trivial.
4. With lazy/abusive co-workers, you may have to simply let them know that you're not the assistant they can hand over the boring part to. This may be more difficult than with the managers, especially if you're not good at marking your limits in a firm but polite manner.
However as long as management want you to work where you provide more value, you can simply tell your co-workers something like "I'd love to help you with , AGAIN, but I'm afraid I don't have much free time until Thursday from 7am-8am two weeks from now....". Or you can simply say "I'd love to help you with , but I've been ordered to focuson , maybe you can explain your need to my manager and have him approve this". One approach is to make it inconvenient for them, the other is to force them to admit some deficiency to management before you help them.