Best Keploy code snippet using generated.marshalN__TypeKind2string
generated.go
Source:generated.go
...1573 return graphql.Null1574 }1575 res := resTmp.(string)1576 fc.Result = res1577 return ec.marshalN__TypeKind2string(ctx, field.Selections, res)1578}1579func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1580 defer func() {1581 if r := recover(); r != nil {1582 ec.Error(ctx, ec.Recover(ctx, r))1583 ret = graphql.Null1584 }1585 }()1586 fc := &graphql.FieldContext{1587 Object: "__Type",1588 Field: field,1589 Args: nil,1590 IsMethod: true,1591 IsResolver: false,1592 }1593 ctx = graphql.WithFieldContext(ctx, fc)1594 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1595 ctx = rctx // use context from middleware stack in children1596 return obj.Name(), nil1597 })1598 if err != nil {1599 ec.Error(ctx, err)1600 return graphql.Null1601 }1602 if resTmp == nil {1603 return graphql.Null1604 }1605 res := resTmp.(*string)1606 fc.Result = res1607 return ec.marshalOString2ástring(ctx, field.Selections, res)1608}1609func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1610 defer func() {1611 if r := recover(); r != nil {1612 ec.Error(ctx, ec.Recover(ctx, r))1613 ret = graphql.Null1614 }1615 }()1616 fc := &graphql.FieldContext{1617 Object: "__Type",1618 Field: field,1619 Args: nil,1620 IsMethod: true,1621 IsResolver: false,1622 }1623 ctx = graphql.WithFieldContext(ctx, fc)1624 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1625 ctx = rctx // use context from middleware stack in children1626 return obj.Description(), nil1627 })1628 if err != nil {1629 ec.Error(ctx, err)1630 return graphql.Null1631 }1632 if resTmp == nil {1633 return graphql.Null1634 }1635 res := resTmp.(string)1636 fc.Result = res1637 return ec.marshalOString2string(ctx, field.Selections, res)1638}1639func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1640 defer func() {1641 if r := recover(); r != nil {1642 ec.Error(ctx, ec.Recover(ctx, r))1643 ret = graphql.Null1644 }1645 }()1646 fc := &graphql.FieldContext{1647 Object: "__Type",1648 Field: field,1649 Args: nil,1650 IsMethod: true,1651 IsResolver: false,1652 }1653 ctx = graphql.WithFieldContext(ctx, fc)1654 rawArgs := field.ArgumentMap(ec.Variables)1655 args, err := ec.field___Type_fields_args(ctx, rawArgs)1656 if err != nil {1657 ec.Error(ctx, err)1658 return graphql.Null1659 }1660 fc.Args = args1661 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1662 ctx = rctx // use context from middleware stack in children1663 return obj.Fields(args["includeDeprecated"].(bool)), nil1664 })1665 if err != nil {1666 ec.Error(ctx, err)1667 return graphql.Null1668 }1669 if resTmp == nil {1670 return graphql.Null1671 }1672 res := resTmp.([]introspection.Field)1673 fc.Result = res1674 return ec.marshalO__Field2ágithubácomá99designságqlgenágraphqláintrospectionáFieldá(ctx, field.Selections, res)1675}1676func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1677 defer func() {1678 if r := recover(); r != nil {1679 ec.Error(ctx, ec.Recover(ctx, r))1680 ret = graphql.Null1681 }1682 }()1683 fc := &graphql.FieldContext{1684 Object: "__Type",1685 Field: field,1686 Args: nil,1687 IsMethod: true,1688 IsResolver: false,1689 }1690 ctx = graphql.WithFieldContext(ctx, fc)1691 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1692 ctx = rctx // use context from middleware stack in children1693 return obj.Interfaces(), nil1694 })1695 if err != nil {1696 ec.Error(ctx, err)1697 return graphql.Null1698 }1699 if resTmp == nil {1700 return graphql.Null1701 }1702 res := resTmp.([]introspection.Type)1703 fc.Result = res1704 return ec.marshalO__Type2ágithubácomá99designságqlgenágraphqláintrospectionáTypeá(ctx, field.Selections, res)1705}1706func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1707 defer func() {1708 if r := recover(); r != nil {1709 ec.Error(ctx, ec.Recover(ctx, r))1710 ret = graphql.Null1711 }1712 }()1713 fc := &graphql.FieldContext{1714 Object: "__Type",1715 Field: field,1716 Args: nil,1717 IsMethod: true,1718 IsResolver: false,1719 }1720 ctx = graphql.WithFieldContext(ctx, fc)1721 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1722 ctx = rctx // use context from middleware stack in children1723 return obj.PossibleTypes(), nil1724 })1725 if err != nil {1726 ec.Error(ctx, err)1727 return graphql.Null1728 }1729 if resTmp == nil {1730 return graphql.Null1731 }1732 res := resTmp.([]introspection.Type)1733 fc.Result = res1734 return ec.marshalO__Type2ágithubácomá99designságqlgenágraphqláintrospectionáTypeá(ctx, field.Selections, res)1735}1736func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1737 defer func() {1738 if r := recover(); r != nil {1739 ec.Error(ctx, ec.Recover(ctx, r))1740 ret = graphql.Null1741 }1742 }()1743 fc := &graphql.FieldContext{1744 Object: "__Type",1745 Field: field,1746 Args: nil,1747 IsMethod: true,1748 IsResolver: false,1749 }1750 ctx = graphql.WithFieldContext(ctx, fc)1751 rawArgs := field.ArgumentMap(ec.Variables)1752 args, err := ec.field___Type_enumValues_args(ctx, rawArgs)1753 if err != nil {1754 ec.Error(ctx, err)1755 return graphql.Null1756 }1757 fc.Args = args1758 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1759 ctx = rctx // use context from middleware stack in children1760 return obj.EnumValues(args["includeDeprecated"].(bool)), nil1761 })1762 if err != nil {1763 ec.Error(ctx, err)1764 return graphql.Null1765 }1766 if resTmp == nil {1767 return graphql.Null1768 }1769 res := resTmp.([]introspection.EnumValue)1770 fc.Result = res1771 return ec.marshalO__EnumValue2ágithubácomá99designságqlgenágraphqláintrospectionáEnumValueá(ctx, field.Selections, res)1772}1773func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1774 defer func() {1775 if r := recover(); r != nil {1776 ec.Error(ctx, ec.Recover(ctx, r))1777 ret = graphql.Null1778 }1779 }()1780 fc := &graphql.FieldContext{1781 Object: "__Type",1782 Field: field,1783 Args: nil,1784 IsMethod: true,1785 IsResolver: false,1786 }1787 ctx = graphql.WithFieldContext(ctx, fc)1788 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1789 ctx = rctx // use context from middleware stack in children1790 return obj.InputFields(), nil1791 })1792 if err != nil {1793 ec.Error(ctx, err)1794 return graphql.Null1795 }1796 if resTmp == nil {1797 return graphql.Null1798 }1799 res := resTmp.([]introspection.InputValue)1800 fc.Result = res1801 return ec.marshalO__InputValue2ágithubácomá99designságqlgenágraphqláintrospectionáInputValueá(ctx, field.Selections, res)1802}1803func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) {1804 defer func() {1805 if r := recover(); r != nil {1806 ec.Error(ctx, ec.Recover(ctx, r))1807 ret = graphql.Null1808 }1809 }()1810 fc := &graphql.FieldContext{1811 Object: "__Type",1812 Field: field,1813 Args: nil,1814 IsMethod: true,1815 IsResolver: false,1816 }1817 ctx = graphql.WithFieldContext(ctx, fc)1818 resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {1819 ctx = rctx // use context from middleware stack in children1820 return obj.OfType(), nil1821 })1822 if err != nil {1823 ec.Error(ctx, err)1824 return graphql.Null1825 }1826 if resTmp == nil {1827 return graphql.Null1828 }1829 res := resTmp.(*introspection.Type)1830 fc.Result = res1831 return ec.marshalO__Type2ágithubácomá99designságqlgenágraphqláintrospectionáType(ctx, field.Selections, res)1832}1833// endregion **************************** field.gotpl *****************************1834// region **************************** input.gotpl *****************************1835// endregion **************************** input.gotpl *****************************1836// region ************************** interface.gotpl ***************************1837// endregion ************************** interface.gotpl ***************************1838// region **************************** object.gotpl ****************************1839var chatroomImplementors = []string{"Chatroom"}1840func (ec *executionContext) _Chatroom(ctx context.Context, sel ast.SelectionSet, obj *Chatroom) graphql.Marshaler {1841 fields := graphql.CollectFields(ec.OperationContext, sel, chatroomImplementors)1842 out := graphql.NewFieldSet(fields)1843 var invalids uint321844 for i, field := range fields {1845 switch field.Name {1846 case "__typename":1847 out.Values[i] = graphql.MarshalString("Chatroom")1848 case "name":1849 out.Values[i] = ec._Chatroom_name(ctx, field, obj)1850 if out.Values[i] == graphql.Null {1851 invalids++1852 }1853 case "messages":1854 out.Values[i] = ec._Chatroom_messages(ctx, field, obj)1855 if out.Values[i] == graphql.Null {1856 invalids++1857 }1858 default:1859 panic("unknown field " + strconv.Quote(field.Name))1860 }1861 }1862 out.Dispatch()1863 if invalids > 0 {1864 return graphql.Null1865 }1866 return out1867}1868var messageImplementors = []string{"Message"}1869func (ec *executionContext) _Message(ctx context.Context, sel ast.SelectionSet, obj *Message) graphql.Marshaler {1870 fields := graphql.CollectFields(ec.OperationContext, sel, messageImplementors)1871 out := graphql.NewFieldSet(fields)1872 var invalids uint321873 for i, field := range fields {1874 switch field.Name {1875 case "__typename":1876 out.Values[i] = graphql.MarshalString("Message")1877 case "id":1878 out.Values[i] = ec._Message_id(ctx, field, obj)1879 if out.Values[i] == graphql.Null {1880 invalids++1881 }1882 case "text":1883 out.Values[i] = ec._Message_text(ctx, field, obj)1884 if out.Values[i] == graphql.Null {1885 invalids++1886 }1887 case "createdBy":1888 out.Values[i] = ec._Message_createdBy(ctx, field, obj)1889 if out.Values[i] == graphql.Null {1890 invalids++1891 }1892 case "createdAt":1893 out.Values[i] = ec._Message_createdAt(ctx, field, obj)1894 if out.Values[i] == graphql.Null {1895 invalids++1896 }1897 default:1898 panic("unknown field " + strconv.Quote(field.Name))1899 }1900 }1901 out.Dispatch()1902 if invalids > 0 {1903 return graphql.Null1904 }1905 return out1906}1907var mutationImplementors = []string{"Mutation"}1908func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {1909 fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors)1910 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{1911 Object: "Mutation",1912 })1913 out := graphql.NewFieldSet(fields)1914 var invalids uint321915 for i, field := range fields {1916 switch field.Name {1917 case "__typename":1918 out.Values[i] = graphql.MarshalString("Mutation")1919 case "post":1920 out.Values[i] = ec._Mutation_post(ctx, field)1921 if out.Values[i] == graphql.Null {1922 invalids++1923 }1924 default:1925 panic("unknown field " + strconv.Quote(field.Name))1926 }1927 }1928 out.Dispatch()1929 if invalids > 0 {1930 return graphql.Null1931 }1932 return out1933}1934var queryImplementors = []string{"Query"}1935func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler {1936 fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors)1937 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{1938 Object: "Query",1939 })1940 out := graphql.NewFieldSet(fields)1941 var invalids uint321942 for i, field := range fields {1943 switch field.Name {1944 case "__typename":1945 out.Values[i] = graphql.MarshalString("Query")1946 case "room":1947 field := field1948 out.Concurrently(i, func() (res graphql.Marshaler) {1949 defer func() {1950 if r := recover(); r != nil {1951 ec.Error(ctx, ec.Recover(ctx, r))1952 }1953 }()1954 res = ec._Query_room(ctx, field)1955 return res1956 })1957 case "__type":1958 out.Values[i] = ec._Query___type(ctx, field)1959 case "__schema":1960 out.Values[i] = ec._Query___schema(ctx, field)1961 default:1962 panic("unknown field " + strconv.Quote(field.Name))1963 }1964 }1965 out.Dispatch()1966 if invalids > 0 {1967 return graphql.Null1968 }1969 return out1970}1971var subscriptionImplementors = []string{"Subscription"}1972func (ec *executionContext) _Subscription(ctx context.Context, sel ast.SelectionSet) func() graphql.Marshaler {1973 fields := graphql.CollectFields(ec.OperationContext, sel, subscriptionImplementors)1974 ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{1975 Object: "Subscription",1976 })1977 if len(fields) != 1 {1978 ec.Errorf(ctx, "must subscribe to exactly one stream")1979 return nil1980 }1981 switch fields[0].Name {1982 case "messageAdded":1983 return ec._Subscription_messageAdded(ctx, fields[0])1984 default:1985 panic("unknown field " + strconv.Quote(fields[0].Name))1986 }1987}1988var __DirectiveImplementors = []string{"__Directive"}1989func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler {1990 fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors)1991 out := graphql.NewFieldSet(fields)1992 var invalids uint321993 for i, field := range fields {1994 switch field.Name {1995 case "__typename":1996 out.Values[i] = graphql.MarshalString("__Directive")1997 case "name":1998 out.Values[i] = ec.___Directive_name(ctx, field, obj)1999 if out.Values[i] == graphql.Null {2000 invalids++2001 }2002 case "description":2003 out.Values[i] = ec.___Directive_description(ctx, field, obj)2004 case "locations":2005 out.Values[i] = ec.___Directive_locations(ctx, field, obj)2006 if out.Values[i] == graphql.Null {2007 invalids++2008 }2009 case "args":2010 out.Values[i] = ec.___Directive_args(ctx, field, obj)2011 if out.Values[i] == graphql.Null {2012 invalids++2013 }2014 case "isRepeatable":2015 out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj)2016 if out.Values[i] == graphql.Null {2017 invalids++2018 }2019 default:2020 panic("unknown field " + strconv.Quote(field.Name))2021 }2022 }2023 out.Dispatch()2024 if invalids > 0 {2025 return graphql.Null2026 }2027 return out2028}2029var __EnumValueImplementors = []string{"__EnumValue"}2030func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler {2031 fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors)2032 out := graphql.NewFieldSet(fields)2033 var invalids uint322034 for i, field := range fields {2035 switch field.Name {2036 case "__typename":2037 out.Values[i] = graphql.MarshalString("__EnumValue")2038 case "name":2039 out.Values[i] = ec.___EnumValue_name(ctx, field, obj)2040 if out.Values[i] == graphql.Null {2041 invalids++2042 }2043 case "description":2044 out.Values[i] = ec.___EnumValue_description(ctx, field, obj)2045 case "isDeprecated":2046 out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj)2047 if out.Values[i] == graphql.Null {2048 invalids++2049 }2050 case "deprecationReason":2051 out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj)2052 default:2053 panic("unknown field " + strconv.Quote(field.Name))2054 }2055 }2056 out.Dispatch()2057 if invalids > 0 {2058 return graphql.Null2059 }2060 return out2061}2062var __FieldImplementors = []string{"__Field"}2063func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler {2064 fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors)2065 out := graphql.NewFieldSet(fields)2066 var invalids uint322067 for i, field := range fields {2068 switch field.Name {2069 case "__typename":2070 out.Values[i] = graphql.MarshalString("__Field")2071 case "name":2072 out.Values[i] = ec.___Field_name(ctx, field, obj)2073 if out.Values[i] == graphql.Null {2074 invalids++2075 }2076 case "description":2077 out.Values[i] = ec.___Field_description(ctx, field, obj)2078 case "args":2079 out.Values[i] = ec.___Field_args(ctx, field, obj)2080 if out.Values[i] == graphql.Null {2081 invalids++2082 }2083 case "type":2084 out.Values[i] = ec.___Field_type(ctx, field, obj)2085 if out.Values[i] == graphql.Null {2086 invalids++2087 }2088 case "isDeprecated":2089 out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj)2090 if out.Values[i] == graphql.Null {2091 invalids++2092 }2093 case "deprecationReason":2094 out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj)2095 default:2096 panic("unknown field " + strconv.Quote(field.Name))2097 }2098 }2099 out.Dispatch()2100 if invalids > 0 {2101 return graphql.Null2102 }2103 return out2104}2105var __InputValueImplementors = []string{"__InputValue"}2106func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler {2107 fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors)2108 out := graphql.NewFieldSet(fields)2109 var invalids uint322110 for i, field := range fields {2111 switch field.Name {2112 case "__typename":2113 out.Values[i] = graphql.MarshalString("__InputValue")2114 case "name":2115 out.Values[i] = ec.___InputValue_name(ctx, field, obj)2116 if out.Values[i] == graphql.Null {2117 invalids++2118 }2119 case "description":2120 out.Values[i] = ec.___InputValue_description(ctx, field, obj)2121 case "type":2122 out.Values[i] = ec.___InputValue_type(ctx, field, obj)2123 if out.Values[i] == graphql.Null {2124 invalids++2125 }2126 case "defaultValue":2127 out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj)2128 default:2129 panic("unknown field " + strconv.Quote(field.Name))2130 }2131 }2132 out.Dispatch()2133 if invalids > 0 {2134 return graphql.Null2135 }2136 return out2137}2138var __SchemaImplementors = []string{"__Schema"}2139func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler {2140 fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors)2141 out := graphql.NewFieldSet(fields)2142 var invalids uint322143 for i, field := range fields {2144 switch field.Name {2145 case "__typename":2146 out.Values[i] = graphql.MarshalString("__Schema")2147 case "types":2148 out.Values[i] = ec.___Schema_types(ctx, field, obj)2149 if out.Values[i] == graphql.Null {2150 invalids++2151 }2152 case "queryType":2153 out.Values[i] = ec.___Schema_queryType(ctx, field, obj)2154 if out.Values[i] == graphql.Null {2155 invalids++2156 }2157 case "mutationType":2158 out.Values[i] = ec.___Schema_mutationType(ctx, field, obj)2159 case "subscriptionType":2160 out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj)2161 case "directives":2162 out.Values[i] = ec.___Schema_directives(ctx, field, obj)2163 if out.Values[i] == graphql.Null {2164 invalids++2165 }2166 default:2167 panic("unknown field " + strconv.Quote(field.Name))2168 }2169 }2170 out.Dispatch()2171 if invalids > 0 {2172 return graphql.Null2173 }2174 return out2175}2176var __TypeImplementors = []string{"__Type"}2177func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler {2178 fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors)2179 out := graphql.NewFieldSet(fields)2180 var invalids uint322181 for i, field := range fields {2182 switch field.Name {2183 case "__typename":2184 out.Values[i] = graphql.MarshalString("__Type")2185 case "kind":2186 out.Values[i] = ec.___Type_kind(ctx, field, obj)2187 if out.Values[i] == graphql.Null {2188 invalids++2189 }2190 case "name":2191 out.Values[i] = ec.___Type_name(ctx, field, obj)2192 case "description":2193 out.Values[i] = ec.___Type_description(ctx, field, obj)2194 case "fields":2195 out.Values[i] = ec.___Type_fields(ctx, field, obj)2196 case "interfaces":2197 out.Values[i] = ec.___Type_interfaces(ctx, field, obj)2198 case "possibleTypes":2199 out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj)2200 case "enumValues":2201 out.Values[i] = ec.___Type_enumValues(ctx, field, obj)2202 case "inputFields":2203 out.Values[i] = ec.___Type_inputFields(ctx, field, obj)2204 case "ofType":2205 out.Values[i] = ec.___Type_ofType(ctx, field, obj)2206 default:2207 panic("unknown field " + strconv.Quote(field.Name))2208 }2209 }2210 out.Dispatch()2211 if invalids > 0 {2212 return graphql.Null2213 }2214 return out2215}2216// endregion **************************** object.gotpl ****************************2217// region ***************************** type.gotpl *****************************2218func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) {2219 res, err := graphql.UnmarshalBoolean(v)2220 return res, graphql.ErrorOnPath(ctx, err)2221}2222func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {2223 res := graphql.MarshalBoolean(v)2224 if res == graphql.Null {2225 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {2226 ec.Errorf(ctx, "must not be null")2227 }2228 }2229 return res2230}2231func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) {2232 res, err := graphql.UnmarshalID(v)2233 return res, graphql.ErrorOnPath(ctx, err)2234}2235func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {2236 res := graphql.MarshalID(v)2237 if res == graphql.Null {2238 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {2239 ec.Errorf(ctx, "must not be null")2240 }2241 }2242 return res2243}2244func (ec *executionContext) marshalNMessage2githubácomá99designságqlgenáexampleáchatáMessage(ctx context.Context, sel ast.SelectionSet, v Message) graphql.Marshaler {2245 return ec._Message(ctx, sel, &v)2246}2247func (ec *executionContext) marshalNMessage2ágithubácomá99designságqlgenáexampleáchatáMessageá(ctx context.Context, sel ast.SelectionSet, v []Message) graphql.Marshaler {2248 ret := make(graphql.Array, len(v))2249 var wg sync.WaitGroup2250 isLen1 := len(v) == 12251 if !isLen1 {2252 wg.Add(len(v))2253 }2254 for i := range v {2255 i := i2256 fc := &graphql.FieldContext{2257 Index: &i,2258 Result: &v[i],2259 }2260 ctx := graphql.WithFieldContext(ctx, fc)2261 f := func(i int) {2262 defer func() {2263 if r := recover(); r != nil {2264 ec.Error(ctx, ec.Recover(ctx, r))2265 ret = nil2266 }2267 }()2268 if !isLen1 {2269 defer wg.Done()2270 }2271 ret[i] = ec.marshalNMessage2githubácomá99designságqlgenáexampleáchatáMessage(ctx, sel, v[i])2272 }2273 if isLen1 {2274 f(i)2275 } else {2276 go f(i)2277 }2278 }2279 wg.Wait()2280 for _, e := range ret {2281 if e == graphql.Null {2282 return graphql.Null2283 }2284 }2285 return ret2286}2287func (ec *executionContext) marshalNMessage2ágithubácomá99designságqlgenáexampleáchatáMessage(ctx context.Context, sel ast.SelectionSet, v *Message) graphql.Marshaler {2288 if v == nil {2289 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {2290 ec.Errorf(ctx, "must not be null")2291 }2292 return graphql.Null2293 }2294 return ec._Message(ctx, sel, v)2295}2296func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) {2297 res, err := graphql.UnmarshalString(v)2298 return res, graphql.ErrorOnPath(ctx, err)2299}2300func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {2301 res := graphql.MarshalString(v)2302 if res == graphql.Null {2303 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {2304 ec.Errorf(ctx, "must not be null")2305 }2306 }2307 return res2308}2309func (ec *executionContext) unmarshalNTime2timeáTime(ctx context.Context, v interface{}) (time.Time, error) {2310 res, err := graphql.UnmarshalTime(v)2311 return res, graphql.ErrorOnPath(ctx, err)2312}2313func (ec *executionContext) marshalNTime2timeáTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler {2314 res := graphql.MarshalTime(v)2315 if res == graphql.Null {2316 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {2317 ec.Errorf(ctx, "must not be null")2318 }2319 }2320 return res2321}2322func (ec *executionContext) marshalN__Directive2githubácomá99designságqlgenágraphqláintrospectionáDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler {2323 return ec.___Directive(ctx, sel, &v)2324}2325func (ec *executionContext) marshalN__Directive2ágithubácomá99designságqlgenágraphqláintrospectionáDirectiveá(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler {2326 ret := make(graphql.Array, len(v))2327 var wg sync.WaitGroup2328 isLen1 := len(v) == 12329 if !isLen1 {2330 wg.Add(len(v))2331 }2332 for i := range v {2333 i := i2334 fc := &graphql.FieldContext{2335 Index: &i,2336 Result: &v[i],2337 }2338 ctx := graphql.WithFieldContext(ctx, fc)2339 f := func(i int) {2340 defer func() {2341 if r := recover(); r != nil {2342 ec.Error(ctx, ec.Recover(ctx, r))2343 ret = nil2344 }2345 }()2346 if !isLen1 {2347 defer wg.Done()2348 }2349 ret[i] = ec.marshalN__Directive2githubácomá99designságqlgenágraphqláintrospectionáDirective(ctx, sel, v[i])2350 }2351 if isLen1 {2352 f(i)2353 } else {2354 go f(i)2355 }2356 }2357 wg.Wait()2358 for _, e := range ret {2359 if e == graphql.Null {2360 return graphql.Null2361 }2362 }2363 return ret2364}2365func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) {2366 res, err := graphql.UnmarshalString(v)2367 return res, graphql.ErrorOnPath(ctx, err)2368}2369func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {2370 res := graphql.MarshalString(v)2371 if res == graphql.Null {2372 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {2373 ec.Errorf(ctx, "must not be null")2374 }2375 }2376 return res2377}2378func (ec *executionContext) unmarshalN__DirectiveLocation2ástringá(ctx context.Context, v interface{}) ([]string, error) {2379 var vSlice []interface{}2380 if v != nil {2381 if tmp1, ok := v.([]interface{}); ok {2382 vSlice = tmp12383 } else {2384 vSlice = []interface{}{v}2385 }2386 }2387 var err error2388 res := make([]string, len(vSlice))2389 for i := range vSlice {2390 ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i))2391 res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i])2392 if err != nil {2393 return nil, err2394 }2395 }2396 return res, nil2397}2398func (ec *executionContext) marshalN__DirectiveLocation2ástringá(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler {2399 ret := make(graphql.Array, len(v))2400 var wg sync.WaitGroup2401 isLen1 := len(v) == 12402 if !isLen1 {2403 wg.Add(len(v))2404 }2405 for i := range v {2406 i := i2407 fc := &graphql.FieldContext{2408 Index: &i,2409 Result: &v[i],2410 }2411 ctx := graphql.WithFieldContext(ctx, fc)2412 f := func(i int) {2413 defer func() {2414 if r := recover(); r != nil {2415 ec.Error(ctx, ec.Recover(ctx, r))2416 ret = nil2417 }2418 }()2419 if !isLen1 {2420 defer wg.Done()2421 }2422 ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i])2423 }2424 if isLen1 {2425 f(i)2426 } else {2427 go f(i)2428 }2429 }2430 wg.Wait()2431 for _, e := range ret {2432 if e == graphql.Null {2433 return graphql.Null2434 }2435 }2436 return ret2437}2438func (ec *executionContext) marshalN__EnumValue2githubácomá99designságqlgenágraphqláintrospectionáEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler {2439 return ec.___EnumValue(ctx, sel, &v)2440}2441func (ec *executionContext) marshalN__Field2githubácomá99designságqlgenágraphqláintrospectionáField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler {2442 return ec.___Field(ctx, sel, &v)2443}2444func (ec *executionContext) marshalN__InputValue2githubácomá99designságqlgenágraphqláintrospectionáInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler {2445 return ec.___InputValue(ctx, sel, &v)2446}2447func (ec *executionContext) marshalN__InputValue2ágithubácomá99designságqlgenágraphqláintrospectionáInputValueá(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler {2448 ret := make(graphql.Array, len(v))2449 var wg sync.WaitGroup2450 isLen1 := len(v) == 12451 if !isLen1 {2452 wg.Add(len(v))2453 }2454 for i := range v {2455 i := i2456 fc := &graphql.FieldContext{2457 Index: &i,2458 Result: &v[i],2459 }2460 ctx := graphql.WithFieldContext(ctx, fc)2461 f := func(i int) {2462 defer func() {2463 if r := recover(); r != nil {2464 ec.Error(ctx, ec.Recover(ctx, r))2465 ret = nil2466 }2467 }()2468 if !isLen1 {2469 defer wg.Done()2470 }2471 ret[i] = ec.marshalN__InputValue2githubácomá99designságqlgenágraphqláintrospectionáInputValue(ctx, sel, v[i])2472 }2473 if isLen1 {2474 f(i)2475 } else {2476 go f(i)2477 }2478 }2479 wg.Wait()2480 for _, e := range ret {2481 if e == graphql.Null {2482 return graphql.Null2483 }2484 }2485 return ret2486}2487func (ec *executionContext) marshalN__Type2githubácomá99designságqlgenágraphqláintrospectionáType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler {2488 return ec.___Type(ctx, sel, &v)2489}2490func (ec *executionContext) marshalN__Type2ágithubácomá99designságqlgenágraphqláintrospectionáTypeá(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler {2491 ret := make(graphql.Array, len(v))2492 var wg sync.WaitGroup2493 isLen1 := len(v) == 12494 if !isLen1 {2495 wg.Add(len(v))2496 }2497 for i := range v {2498 i := i2499 fc := &graphql.FieldContext{2500 Index: &i,2501 Result: &v[i],2502 }2503 ctx := graphql.WithFieldContext(ctx, fc)2504 f := func(i int) {2505 defer func() {2506 if r := recover(); r != nil {2507 ec.Error(ctx, ec.Recover(ctx, r))2508 ret = nil2509 }2510 }()2511 if !isLen1 {2512 defer wg.Done()2513 }2514 ret[i] = ec.marshalN__Type2githubácomá99designságqlgenágraphqláintrospectionáType(ctx, sel, v[i])2515 }2516 if isLen1 {2517 f(i)2518 } else {2519 go f(i)2520 }2521 }2522 wg.Wait()2523 for _, e := range ret {2524 if e == graphql.Null {2525 return graphql.Null2526 }2527 }2528 return ret2529}2530func (ec *executionContext) marshalN__Type2ágithubácomá99designságqlgenágraphqláintrospectionáType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler {2531 if v == nil {2532 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {2533 ec.Errorf(ctx, "must not be null")2534 }2535 return graphql.Null2536 }2537 return ec.___Type(ctx, sel, v)2538}2539func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) {2540 res, err := graphql.UnmarshalString(v)2541 return res, graphql.ErrorOnPath(ctx, err)2542}2543func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler {2544 res := graphql.MarshalString(v)2545 if res == graphql.Null {2546 if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {2547 ec.Errorf(ctx, "must not be null")2548 }2549 }2550 return res2551}2552func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) {2553 res, err := graphql.UnmarshalBoolean(v)2554 return res, graphql.ErrorOnPath(ctx, err)2555}2556func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler {2557 return graphql.MarshalBoolean(v)...
marshalN__TypeKind2string
Using AI Code Generation
1import (2func main() {3 err := yaml.Unmarshal([]byte("2"), &n__TypeKind2string)4 if err != nil {5 panic(err)6 }7 fmt.Println(n__TypeKind2string)8 b, err := yaml.Marshal(n__TypeKind2string)9 if err != nil {10 panic(err)11 }12 fmt.Println(string(b))13}14import (15func main() {16 err := yaml.Unmarshal([]byte("2"), &n__TypeKind2string)17 if err != nil {18 panic(err)19 }20 fmt.Println(n__TypeKind2string)21 b, err := yaml.Marshal(n__TypeKind2string)22 if err != nil {23 panic(err)24 }25 fmt.Println(string(b))26}27import (28func main() {29 err := yaml.Unmarshal([]byte("2"), &n__TypeKind2string)30 if err != nil {31 panic(err)32 }33 fmt.Println(n__TypeKind2string)34 b, err := yaml.Marshal(n__TypeKind2string)35 if err != nil {36 panic(err)37 }38 fmt.Println(string(b))39}40import (41func main() {42 err := yaml.Unmarshal([]byte("2"), &n__TypeKind2string)
marshalN__TypeKind2string
Using AI Code Generation
1func (e EnumTypeKind) MarshalJSON() ([]byte, error) {2 return json.Marshal(marshalEnumTypeKind2string[e])3}4func (e *EnumTypeKind) UnmarshalJSON(text []byte) error {5 if err := json.Unmarshal(text, &enumName); err != nil {6 }7 if val, ok := unmarshalEnumTypeKind2string[enumName]; ok {8 }9 return fmt.Errorf("invalid EnumTypeKind: %q", enumName)10}11func (e EnumTypeKind) String() string {12}13func EnumTypeKindValues() []EnumTypeKind {14 values := make([]EnumTypeKind, 0)15 for _, v := range mappingEnumTypeKind {16 values = append(values, v)17 }18}19func EnumTypeKindFromString(s string) (EnumTypeKind, error) {20 if val, ok := unmarshalEnumTypeKind2string[s]; ok {21 }22 return 0, fmt.Errorf("invalid EnumTypeKind: %s", s)23}24func EnumTypeKindPtr(v EnumTypeKind) *EnumTypeKind {25}26func EnumTypeKindPtrFromString(s string) (*EnumTypeKind, error) {27 v, err := EnumTypeKindFromString(s)28 if err != nil {29 }30}31func (e *EnumTypeKind) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) {32}
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!