admin管理员组文章数量:1194371
Basically what I'm trying to achieve is send info to the server without quotations e.g Admin instead of "Admin", but as we all know Graphql will throw an error is the variable is not defined or is not in quotations.
Basically what I'm trying to achieve is send info to the server without quotations e.g Admin instead of "Admin", but as we all know Graphql will throw an error is the variable is not defined or is not in quotations.
Share Improve this question asked May 2, 2018 at 12:27 404notBrighton404notBrighton 1701 gold badge3 silver badges11 bronze badges5 Answers
Reset to default 16we can create a enum like property as below:
const adminEnum = { Admin: 'Admin'};
Hope I got the question right.
you can use enum with typeScript
in react-native
like describe in the link
sample code is
enum Direction {
Up = 1,
Down,
Left,
Right,
}
I am using Enum in React as below method
is Enum type in GraphQL
const result = apolloclient.mutate({
mutation: reset_password,
variables: {
method: 'EMAIL',
uuid: opts.uuid
}
});
enum Pole { East = 1, West, North, South, }
In a seperate class and a file.
export enum TransportTypeEnum {
OneWay = 0,
Return = 1,
}
import it to other class like
import {TransportTypeEnum} from '../enums/TransportTypeEnum';
本文标签: javascriptHow do i define an enum in react nativeStack Overflow
版权声明:本文标题:javascript - How do i define an enum in react native - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738503633a2090410.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论